[FFmpeg-devel] [PATCH] H264 DXVA2 implementation

Laurent Aimar fenrir
Sun Jan 10 00:46:25 CET 2010


On Sat, Jan 09, 2010, Reimar D?ffinger wrote:
> On Sat, Jan 09, 2010 at 10:43:53PM +0100, Laurent Aimar wrote:
> 
> > +        av_log(avctx, AV_LOG_DEBUG, "Failed to add PP\n");
> > +        av_log(avctx, AV_LOG_DEBUG, "Failed to add QM\n");
> > +                av_log(avctx, AV_LOG_DEBUG, "Failed to build bitstream");
> > +            av_log(avctx, AV_LOG_DEBUG, "Failed to add BS\n");
> > +        av_log(avctx, AV_LOG_DEBUG, "Failed to add SC\n");
> > +        av_log(avctx, AV_LOG_DEBUG, "Failed to execute\n");
> > +        av_log(avctx, AV_LOG_DEBUG, "Failed to end frame\n");
> 
> What is up with these? I can't imagine decoding will work fine if
> any of these happen, yet not only is no error returned (so an application
> doesn't even have a chance to fall back to software decoding),
> there is not even a message printed with the default log level!
 All checked now. From my understanding and my observations, the only
important one missing was 'execute'.

> > +        for (i = 0; i < ctx_pic->slice_count; i++) {
> [...]
> > +            if (i == ctx_pic->slice_count - 1)
> > +                padding = 128 - ((&current[start_code_size + size] - dxva_data) & 127);
> > +            else
> > +                padding = 0;
> > +            if (start_code_size + size + padding > end - current) {
> > +                av_log(avctx, AV_LOG_DEBUG, "Failed to build bitstream");
> > +                break;
> > +            }
> [...]
> > +            if (padding > 0) {
> > +                memset(current, 0, padding);
> > +                current += padding;
> > +            }
> > +        }
> > +        assert(i < ctx_pic->slice_count || ((current - dxva_data) & 127) == 0);
> 
> What's the point of having that padding stuff inside the loop?
 To avoid moving the slice variable to a larger scope. Done anyway.

New patch (v5) attached.

-- 
fenrir




More information about the ffmpeg-devel mailing list