[FFmpeg-devel] [PATCH] lavc/ffv1: Properly check that the 4th and 5th quant tables are zeroes

Jerome Martinez jerome at mediaarea.net
Sat Jan 4 00:16:21 EET 2020


On 03/01/2020 22:59, Derek Buitenhuis wrote:
> On 02/01/2020 23:09, Michael Niedermayer wrote:
>> I think if entry 128 is 0 then the whole table must be 0.
>> If that is the case, checking the entry 128 of table 4 and 5 would be enough
>> and caching the entry comparission is maybe not needed.
> Is this guaranteed somehow? It isn't mentioned in the spec.

Checking better the spec about how the quant table is stored in 
bitstream, we may have missed in our past discussion that it is actually 
not stored as 256 independent values, "QuantizationTable(i, j, scale)" 
permits only increasing numbers from index 0 to 127 (so 128, as index 
128 is the negative of index 127), so it seems that by design of how the 
quant table is stored it is impossible to have 0 at index 128 without 
having 0 at indexes 0-127 (one value of "len - 1", 127, seems to be the 
only way to have 0 at index 128).

The need to check the 5th quant table is still valid.

Jérôme



More information about the ffmpeg-devel mailing list