mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 10:30:05 +01:00
avcodec/h264_cabac: Fix CABAC+8x8dct in 4:4:4
Use the correct ctxIdxInc calculation for coded_block_flag.
Keep old behavior for old versions of x264 for backward compatibility.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 840b41b2a6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
d5abcaacb3
commit
48ab5a4dc0
@@ -2343,21 +2343,40 @@ decode_intra_mb:
|
|||||||
if (CHROMA444(h) && IS_8x8DCT(mb_type)){
|
if (CHROMA444(h) && IS_8x8DCT(mb_type)){
|
||||||
int i;
|
int i;
|
||||||
uint8_t *nnz_cache = sl->non_zero_count_cache;
|
uint8_t *nnz_cache = sl->non_zero_count_cache;
|
||||||
for (i = 0; i < 2; i++){
|
if (h->x264_build < 151U) {
|
||||||
if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) {
|
for (i = 0; i < 2; i++){
|
||||||
nnz_cache[3+8* 1 + 2*8*i]=
|
if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) {
|
||||||
nnz_cache[3+8* 2 + 2*8*i]=
|
nnz_cache[3+8* 1 + 2*8*i]=
|
||||||
nnz_cache[3+8* 6 + 2*8*i]=
|
nnz_cache[3+8* 2 + 2*8*i]=
|
||||||
nnz_cache[3+8* 7 + 2*8*i]=
|
nnz_cache[3+8* 6 + 2*8*i]=
|
||||||
nnz_cache[3+8*11 + 2*8*i]=
|
nnz_cache[3+8* 7 + 2*8*i]=
|
||||||
nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
|
nnz_cache[3+8*11 + 2*8*i]=
|
||||||
|
nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sl->top_type && !IS_8x8DCT(sl->top_type)){
|
||||||
|
uint32_t top_empty = !IS_INTRA(mb_type) ? 0 : 0x40404040;
|
||||||
|
AV_WN32A(&nnz_cache[4+8* 0], top_empty);
|
||||||
|
AV_WN32A(&nnz_cache[4+8* 5], top_empty);
|
||||||
|
AV_WN32A(&nnz_cache[4+8*10], top_empty);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < 2; i++){
|
||||||
|
if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) {
|
||||||
|
nnz_cache[3+8* 1 + 2*8*i]=
|
||||||
|
nnz_cache[3+8* 2 + 2*8*i]=
|
||||||
|
nnz_cache[3+8* 6 + 2*8*i]=
|
||||||
|
nnz_cache[3+8* 7 + 2*8*i]=
|
||||||
|
nnz_cache[3+8*11 + 2*8*i]=
|
||||||
|
nnz_cache[3+8*12 + 2*8*i]= !IS_INTRA_PCM(sl->left_type[LEFT(i)]) ? 0 : 64;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sl->top_type && !IS_8x8DCT(sl->top_type)){
|
||||||
|
uint32_t top_empty = !IS_INTRA_PCM(sl->top_type) ? 0 : 0x40404040;
|
||||||
|
AV_WN32A(&nnz_cache[4+8* 0], top_empty);
|
||||||
|
AV_WN32A(&nnz_cache[4+8* 5], top_empty);
|
||||||
|
AV_WN32A(&nnz_cache[4+8*10], top_empty);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (sl->top_type && !IS_8x8DCT(sl->top_type)){
|
|
||||||
uint32_t top_empty = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 0x40404040;
|
|
||||||
AV_WN32A(&nnz_cache[4+8* 0], top_empty);
|
|
||||||
AV_WN32A(&nnz_cache[4+8* 5], top_empty);
|
|
||||||
AV_WN32A(&nnz_cache[4+8*10], top_empty);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h->cur_pic.mb_type[mb_xy] = mb_type;
|
h->cur_pic.mb_type[mb_xy] = mb_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user