[FFmpeg-devel] Google Summer of Code participation

Michael Niedermayer michaelni
Thu Apr 9 19:28:27 CEST 2009


On Thu, Apr 09, 2009 at 04:59:38PM +0200, Thilo Borgmann wrote:
>
>
> Michael Niedermayer schrieb:
>>
>>> @@ -377,6 +378,13 @@ static int png_decode_idat(PNGDecContext *s, int 
>>> length)
>>>      return 0;
>>>  }
>>>  +static void png_flip_pictures(PNGDecContext *s)
>>> +{
>>> +    AVFrame *dummy = s->current_picture;
>>> +    s->current_picture = s->last_picture;
>>> +    s->last_picture = dummy;
>>> +}
>>> +
>>>     
>>
>> FFSWAP
>>
>>   
> Ok.
>>> +                for(i=0; i < s->width; i++) {
>>> +                    pd[offset + 0 + i*3] = pd[offset + 0 + i*3] + 
>>> pd_last[offset + 0 + i*3];
>>> +                    pd[offset + 1 + i*3] = pd[offset + 1 + i*3] + 
>>> pd_last[offset + 1 + i*3];
>>> +                    pd[offset + 2 + i*3] = pd[offset + 2 + i*3] + 
>>> pd_last[offset + 2 + i*3];
>>> +                }
>>>     
>>
>> for(j=0; j<width*3; j++)
>>
>>   
> Hm. But what about the bits per pixel problem?
> If you want width there, then I propose:
>

> for(j=0; j<width*s->bpp; j++)

yes


>
> Which is fail safe if s->bit_depth != 8.
> If you realy want width*3 then there has to be something I don't 
> understand. If that's the case, please tell me why "3" will always work...
>>> @@ -602,8 +632,10 @@ static int decode_frame(AVCodecContext *avctx,
>>>  static av_cold int png_dec_init(AVCodecContext *avctx){
>>>      PNGDecContext *s = avctx->priv_data;
>>>  -    avcodec_get_frame_defaults(&s->picture);
>>> -    avctx->coded_frame= &s->picture;
>>> +    s->current_picture = &s->picture1;
>>> +    s->last_picture = &s->picture2;
>>> +    avcodec_get_frame_defaults(&s->picture1);
>>>     
>>
>>   
>>> +    avctx->coded_frame= &s->picture1;
>>>     
>>
>> this is wrong
>>
>>   
> I carried it over from the original code. Although it can be deleted 
> completely, it might be set "avctx->coded_frame = &s->picture2" to respect 
> the initial flip in decode frame and thus keep close to the original. If 
> not, what is wrong?

it should point to the current frame not to every second frame 

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090409/b64d188c/attachment.pgp>



More information about the ffmpeg-devel mailing list