On 08/11/2014 10:35 AM, Diego Biurrun wrote:
> On Mon, Aug 11, 2014 at 07:36:48AM -0700, John Stebbins wrote:
>> --- a/libavcodec/mpeg12dec.c
>> +++ b/libavcodec/mpeg12dec.c
>> @@ -1097,18 +1097,16 @@ static av_cold int mpeg_decode_init(AVCodecContext 
>> *avctx)
>>  {
>>      Mpeg1Context *s    = avctx->priv_data;
>>      MpegEncContext *s2 = &s->mpeg_enc_ctx;
>> -    int i;
>> -
>> -    /* we need some permutation to store matrices,
>> -     * until MPV_common_init() sets the real permutation. */
>> -    for (i = 0; i < 64; i++)
>> -        s2->idsp.idct_permutation[i] = i;
>>  
>>      ff_MPV_decode_defaults(s2);
>>  
>>      s->mpeg_enc_ctx.avctx  = avctx;
>>      s->mpeg_enc_ctx.flags  = avctx->flags;
>>      s->mpeg_enc_ctx.flags2 = avctx->flags2;
>> +
>> +    /* we need some permutation to store matrices,
>> +     * until ff_mpv_idct_init() sets the real permutation. */
>> +    ff_mpv_idct_init(s2);
>>      ff_mpeg12_common_init(&s->mpeg_enc_ctx);
>>      ff_mpeg12_init_vlcs();
> This bit looks suspicious; at least the comment does no longer match
> the code.

The code is correct.  I moved it down a few lines because ff_mpv_idct_init 
references s2->avctx.  But if you don't like
useing ff_mpv_idct_init for dummy initialization, I can certainly revert this 
and just update the comment.

I guess the comment is a bit misleading now.  It means the *next* call to 
ff_mpv_idct_init that will happen in
mpeg_decode_postinit.  How about simplifying to:
/* we need some permutation to store matrices until the decoder sets the real 
permutation */

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to