aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2014-01-19 19:04:59 +0100
committerAnton Khirnov <anton@khirnov.net>2014-01-24 07:03:11 +0100
commit50866c8d95bfd97c299199aec0d68291f38a72e1 (patch)
treeb51c581f6238ba3289f884ce65d5dabd2a82abd3 /libavcodec
parentbd01412313c728400f1fc5448ede0ad8b51da0d1 (diff)
downloadffmpeg-50866c8d95bfd97c299199aec0d68291f38a72e1.tar.gz
vp9: fix bugs in updating coef probabilities with parallelmode=1
- The memcpy was completely wrong because s->prob_ctx[s->framectxid].coef is a [4][2][2][6][6][3] array, whereas s->prob.coef is a [4][2][2][6][6][11] array. - The additional check was committed to ffmpeg by Ronald S. Bultje. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp9.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 9048700fb7..c04a3b8fc3 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -1144,8 +1144,17 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
// probability maintenance between frames)
if (s->refreshctx) {
if (s->parallelmode) {
- memcpy(s->prob_ctx[s->framectxid].coef, s->prob.coef,
- sizeof(s->prob.coef));
+ int j, k, l, m;
+ 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;
+ }
s->prob_ctx[s->framectxid].p = s->prob.p;
} else {
ff_vp9_adapt_probs(s);