[FFmpeg-cvslog] r20957 - in trunk/libavcodec: Makefile allcodecs.c vaapi_h264.c

Reimar Döffinger Reimar.Doeffinger
Tue Dec 29 10:03:07 CET 2009


On Tue, Dec 29, 2009 at 09:48:19AM +0100, gb wrote:
> +/**
> + * Appends picture to the decoded picture buffer, in a VA API form that
> + * merges the second field picture attributes with the first, if
> + * available.  The decoded picture buffer's size must be large enough
> + * to receive the new VA API picture object.
> + */
> +static int dpb_add(DPB *dpb, Picture *pic)
> +{
> +    int i;
> +
> +    if (dpb->size >= dpb->max_size)
> +        return -1;
> +
> +    for (i = 0; i < dpb->size; i++) {
> +        VAPictureH264 * const va_pic = &dpb->va_pics[i];
> +        if (va_pic->picture_id == ff_vaapi_get_surface_id(pic)) {
> +            VAPictureH264 temp_va_pic;
> +            fill_vaapi_pic(&temp_va_pic, pic, 0);
> +
> +            if ((temp_va_pic.flags ^ va_pic->flags) & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD)) {
> +                va_pic->flags |= temp_va_pic.flags & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD);

IMO this must either be documented better or simplified and fixed,
because currently the behaviour does not match the description if e.g.
one of these is a complete frame but the other one is only one field.
I also wonder if there are possibly error conditions where this will
end up merging the wrong fields.



More information about the ffmpeg-cvslog mailing list