[FFmpeg-devel] [PATCH 3/9] avformat/s337m: Consider container bit resolution

Gaullier Nicolas nicolas.gaullier at cji.paris
Mon Jan 13 16:02:32 EET 2020


>> +    if (container_word_bits && (container_word_bits+7)/8 != 
>> + (word_bits+7)/8) {
>
>Can it happen that word_bits is anything but 16 or 24 with a valid stream? If not then I'd check container_word_bits == word_bits && (word_bits == 16 || word_bits == 24) or so
word_bits may be 20, and in that case container_word_bits must be 24 (this is the case in my fate test), so I think this is correct.

>> +    while ((container_word_bits == 24 || !IS_16LE_MARKER(state))
>> +        && (container_word_bits == 16 || !IS_20LE_MARKER(state) && 
>> + !IS_24LE_MARKER(state))) {
>
>I'd rewrite this as while ((bits == 24 && (20LE || 24LE)) || (bits ==20 && 16LE)), more readable
container_word_bits may be 0 for autodetect, this results in this expression...
I agree it is not that great for readability, but doing otherwise would require some additions and macros duplications, for example:
while ( !(!bits && LE) || !(bits == 24 && (20LE || 24LE)) || !(bits ==16 && 16LE))
Sounds heavy, not sure this is really better ?

Nicolas


More information about the ffmpeg-devel mailing list