[Ffmpeg-devel] Re: [PATCH] fix DV encoder VLC bit accounting

Roman Shaposhnick rvs
Wed Feb 22 02:15:33 CET 2006


On Mon, Feb 20, 2006 at 12:27:15AM -0500, Dan Maas wrote:
> Details: When dv_guess_qnos() increases the quantization step for a
> DCT block area, some of its AC coefficients may become zero. If this
> happens, it increases the length of the corresponding run of zero
> bits. VLC code lengths depend on run length, so this change can affect
> the RLE-encoded size of the following block areas. Without the patch,
> dv_guess_qnos() ignores this possibility, so the final RLE-encoded
> size of the block may be larger than the sum of bit_size[]. This can
> cause the AC bitstream to overflow the allotted number of bits,
> corrupting the block.
> 
> (Roman, this patch is slightly more optimized than the version I sent
> you earlier. It doesn't re-compute the VLC length unless at least one
> AC coefficient was quantized to zero in a preceding area.)

  One question before I apply it -- did you measure the performance 
  degradation with this patch (at least roughly speaking) ?

Thanks,
Roman.





More information about the ffmpeg-devel mailing list