[FFmpeg-devel] [PATCH] vp9: fix bug in updating of coef probabilities with parallelmode=1.
Clément Bœsch
u at pkh.me
Tue Dec 24 10:56:49 CET 2013
On Mon, Dec 23, 2013 at 09:41:35PM -0500, Ronald S. Bultje wrote:
> Fixes trac 3228.
> ---
> libavcodec/vp9.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index a52924c..88c5bc6 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c
> @@ -3547,13 +3547,16 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
> if (s->refreshctx && s->parallelmode) {
> int j, k, l, m;
>
> - for (i = 0; i < 4; i++)
> + for (i = 0; i < 4; i++) {
> for (j = 0; j < 2; j++)
> for (k = 0; k < 2; k++)
> for (l = 0; l < 6; l++)
> for (m = 0; m < 6; m++)
> memcpy(s->prob_ctx[s->framectxid].coef[i][j][k][l][m],
> s->prob.coef[i][j][k][l][m], 3);
> + if (s->txfmmode == i)
> + break;
> + }
I tested with some other samples, output looks ok, no valgrind complain
(if we strip out the current weird stack bug).
little nit: we could probably just change the loop into
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4 && i <= s->txfmmode; i++)
...but I'm assuming you're just getting consistent with the coeff updates
code.
Patch is fine anyway.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131224/06ea7831/attachment.asc>
More information about the ffmpeg-devel
mailing list