[FFmpeg-devel] [PATCH] H264 DXVA2 implementation

Reimar Döffinger Reimar.Doeffinger
Sat Jan 9 23:11:40 CET 2010


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!

> +        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?



More information about the ffmpeg-devel mailing list