[FFmpeg-devel] [PATCH] mpeg2 non linear quantizer full support

Baptiste Coudurier baptiste.coudurier
Tue Mar 18 15:55:32 CET 2008


Hi,

Michael Niedermayer wrote:
> On Wed, Mar 12, 2008 at 07:38:42PM +0100, Baptiste Coudurier wrote:
>> Hi,
>>
>> $subject.
>>
>> Diff for some files is to show possible simplifications of existing
>> code. I'll of course split the commits. Only mpeg-2 unquantize functions
>> are affected.
>>
>> Regression tests pass.
> [...]
> 
> 
>> Index: libavcodec/mpegvideo.c
>> ===================================================================
>> --- libavcodec/mpegvideo.c	(revision 12407)
>> +++ libavcodec/mpegvideo.c	(working copy)
>> @@ -33,6 +33,7 @@
>>  #include "mpegvideo_common.h"
>>  #include "mjpegenc.h"
>>  #include "msmpeg4.h"
>> +#include "mpeg12.h"
>>  #include "faandct.h"
>>  #include <limits.h>
>>  
>> @@ -2149,6 +2150,8 @@
>>          block[0] = block[0] * s->y_dc_scale;
>>      else
>>          block[0] = block[0] * s->c_dc_scale;
>> +
>> +    qscale = s->qscale_table[qscale];
> 
> Doing the remaping in the dequant function means that its done 6 times (
> 4 luma and 2 chroma) for 420, it might be more efficient to do it at some
> oher place or maybe even keep qscale some linear quantizer scale instead
> of a possibly non linear qp.
> That is have 2 variables, qp which might be non linear and qscale which is
> always the actual scale with which things get multiplied. Although iam not
> sure if this really is better, maybe there are some problems iam missing ...
> 
> 

Ok, I added a qp field, which is updated in ff_set_qscale.
Regression tests still pass.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG SAS                                     http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: non_linear_q2.patch
Type: text/x-diff
Size: 21322 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080318/4fb119a1/attachment.patch>



More information about the ffmpeg-devel mailing list