Commit b7e0356c authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'f69574cf'

* commit 'f69574cf':
  h264: move non_zero_count_cache into the per-slice context

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 6ec279b5 f69574cf
......@@ -64,11 +64,12 @@ static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
int mb_x, int mb_y, int mb_intra, int mb_skipped)
{
H264Context *h = opaque;
H264SliceContext *sl = &h->slice_ctx[0];
h->mb_x = mb_x;
h->mb_y = mb_y;
h->mb_xy = mb_x + mb_y * h->mb_stride;
memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache));
memset(sl->non_zero_count_cache, 0, sizeof(sl->non_zero_count_cache));
av_assert1(ref >= 0);
/* FIXME: It is possible albeit uncommon that slice references
* differ between slices. We take the easy approach and ignore
......
......@@ -378,6 +378,12 @@ typedef struct H264SliceContext {
unsigned int top_samples_available;
unsigned int topright_samples_available;
unsigned int left_samples_available;
/**
* non zero coeff count cache.
* is 64 if not available.
*/
DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8];
} H264SliceContext;
/**
......@@ -420,12 +426,6 @@ typedef struct H264Context {
H264PredContext hpc;
uint8_t (*top_borders[2])[(16 * 3) * 2];
/**
* non zero coeff count cache.
* is 64 if not available.
*/
DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8];
uint8_t (*non_zero_count)[48];
/**
......@@ -1017,11 +1017,12 @@ static av_always_inline void write_back_intra_pred_mode(H264Context *h,
i4x4[6] = i4x4_cache[7 + 8 * 1];
}
static av_always_inline void write_back_non_zero_count(H264Context *h)
static av_always_inline void write_back_non_zero_count(H264Context *h,
H264SliceContext *sl)
{
const int mb_xy = h->mb_xy;
uint8_t *nnz = h->non_zero_count[mb_xy];
uint8_t *nnz_cache = h->non_zero_count_cache;
uint8_t *nnz_cache = sl->non_zero_count_cache;
AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]);
AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]);
......
This diff is collapsed.
......@@ -284,10 +284,11 @@ static int8_t cavlc_level_tab[7][1<<LEVEL_TAB_BITS][2];
* Get the predicted number of non-zero coefficients.
* @param n block index
*/
static inline int pred_non_zero_count(H264Context *h, int n){
static inline int pred_non_zero_count(H264Context *h, H264SliceContext *sl, int n)
{
const int index8= scan8[n];
const int left= h->non_zero_count_cache[index8 - 1];
const int top = h->non_zero_count_cache[index8 - 8];
const int left = sl->non_zero_count_cache[index8 - 1];
const int top = sl->non_zero_count_cache[index8 - 8];
int i= left + top;
if(i<64) i= (i+1)>>1;
......@@ -442,7 +443,11 @@ static inline int get_level_prefix(GetBitContext *gb){
* @param max_coeff number of coefficients in the block
* @return <0 if an error occurred
*/
static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
static int decode_residual(H264Context *h, H264SliceContext *sl,
GetBitContext *gb, int16_t *block, int n,
const uint8_t *scantable, const uint32_t *qmul,
int max_coeff)
{
static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
int level[16];
int zeros_left, coeff_token, total_coeff, i, trailing_ones, run_before;
......@@ -457,16 +462,16 @@ static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, in
total_coeff= coeff_token>>2;
}else{
if(n >= LUMA_DC_BLOCK_INDEX){
total_coeff= pred_non_zero_count(h, (n - LUMA_DC_BLOCK_INDEX)*16);
total_coeff= pred_non_zero_count(h, sl, (n - LUMA_DC_BLOCK_INDEX)*16);
coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
total_coeff= coeff_token>>2;
}else{
total_coeff= pred_non_zero_count(h, n);
total_coeff= pred_non_zero_count(h, sl, n);
coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
total_coeff= coeff_token>>2;
}
}
h->non_zero_count_cache[ scan8[n] ]= total_coeff;
sl->non_zero_count_cache[scan8[n]] = total_coeff;
//FIXME set last_non_zero?
......@@ -638,7 +643,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex
AV_ZERO128(h->mb_luma_dc[p]+8);
AV_ZERO128(h->mb_luma_dc[p]+16);
AV_ZERO128(h->mb_luma_dc[p]+24);
if( decode_residual(h, h->intra_gb_ptr, h->mb_luma_dc[p], LUMA_DC_BLOCK_INDEX+p, scan, NULL, 16) < 0){
if( decode_residual(h, sl, h->intra_gb_ptr, h->mb_luma_dc[p], LUMA_DC_BLOCK_INDEX+p, scan, NULL, 16) < 0){
return -1; //FIXME continue if partitioned and other return -1 too
}
......@@ -648,7 +653,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex
for(i8x8=0; i8x8<4; i8x8++){
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8 + p*16;
if( decode_residual(h, h->intra_gb_ptr, h->mb + (16*index << pixel_shift),
if( decode_residual(h, sl, h->intra_gb_ptr, h->mb + (16*index << pixel_shift),
index, scan + 1, h->dequant4_coeff[p][qscale], 15) < 0 ){
return -1;
}
......@@ -656,7 +661,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex
}
return 0xf;
}else{
fill_rectangle(&h->non_zero_count_cache[scan8[p*16]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[p*16]], 4, 4, 8, 0, 1);
return 0;
}
}else{
......@@ -670,25 +675,25 @@ static av_always_inline int decode_luma_residual(H264Context *h, H264SliceContex
uint8_t *nnz;
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8 + p*16;
if( decode_residual(h, gb, buf, index, scan8x8+16*i4x4,
if( decode_residual(h, sl, gb, buf, index, scan8x8+16*i4x4,
h->dequant8_coeff[cqm][qscale], 16) < 0 )
return -1;
}
nnz= &h->non_zero_count_cache[ scan8[4*i8x8+p*16] ];
nnz = &sl->non_zero_count_cache[scan8[4 * i8x8 + p * 16]];
nnz[0] += nnz[1] + nnz[8] + nnz[9];
new_cbp |= !!nnz[0] << i8x8;
}else{
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8 + p*16;
if( decode_residual(h, gb, h->mb + (16*index << pixel_shift), index,
if( decode_residual(h, sl, gb, h->mb + (16*index << pixel_shift), index,
scan, h->dequant4_coeff[cqm][qscale], 16) < 0 ){
return -1;
}
new_cbp |= h->non_zero_count_cache[ scan8[index] ] << i8x8;
new_cbp |= sl->non_zero_count_cache[scan8[index]] << i8x8;
}
}
}else{
uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8+p*16] ];
uint8_t * const nnz = &sl->non_zero_count_cache[scan8[4 * i8x8 + p * 16]];
nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0;
}
}
......@@ -1135,7 +1140,7 @@ decode_intra_mb:
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
if (decode_residual(h, gb, h->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
if (decode_residual(h, sl, gb, h->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
CHROMA_DC_BLOCK_INDEX+chroma_idx,
CHROMA422(h) ? chroma422_dc_scan : chroma_dc_scan,
NULL, 4*num_c8x8) < 0) {
......@@ -1150,24 +1155,24 @@ decode_intra_mb:
for (i8x8 = 0; i8x8<num_c8x8; i8x8++) {
for (i4x4 = 0; i4x4 < 4; i4x4++) {
const int index = 16 + 16*chroma_idx + 8*i8x8 + i4x4;
if (decode_residual(h, gb, mb, index, scan + 1, qmul, 15) < 0)
if (decode_residual(h, sl, gb, mb, index, scan + 1, qmul, 15) < 0)
return -1;
mb += 16 << pixel_shift;
}
}
}
}else{
fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
}
}
}else{
fill_rectangle(&h->non_zero_count_cache[scan8[ 0]], 4, 4, 8, 0, 1);
fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[ 0]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
fill_rectangle(&sl->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
}
h->cur_pic.qscale_table[mb_xy] = sl->qscale;
write_back_non_zero_count(h);
write_back_non_zero_count(h, sl);
return 0;
}
......@@ -369,7 +369,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[LTOP] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0;
int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;
edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
h->h264dsp.h264_loop_filter_strength(bS, sl->non_zero_count_cache, h->ref_cache, h->mv_cache,
h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h));
}
if( IS_INTRA(left_type) )
......@@ -510,15 +510,15 @@ static av_always_inline void filter_mb_dir(H264Context *h, H264SliceContext *sl,
AV_WN64A(bS, 0x0003000300030003ULL);
} else {
if (!CABAC(h) && IS_8x8DCT(h->cur_pic.mb_type[mbn_xy])) {
bS[0]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+0]);
bS[1]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+1]);
bS[2]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+2]);
bS[3]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+3]);
bS[0]= 1+((h->cbp_table[mbn_xy] & 0x4000) || sl->non_zero_count_cache[scan8[0]+0]);
bS[1]= 1+((h->cbp_table[mbn_xy] & 0x4000) || sl->non_zero_count_cache[scan8[0]+1]);
bS[2]= 1+((h->cbp_table[mbn_xy] & 0x8000) || sl->non_zero_count_cache[scan8[0]+2]);
bS[3]= 1+((h->cbp_table[mbn_xy] & 0x8000) || sl->non_zero_count_cache[scan8[0]+3]);
}else{
const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 3*4;
int i;
for( i = 0; i < 4; i++ ) {
bS[i] = 1 + !!(h->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]);
bS[i] = 1 + !!(sl->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]);
}
}
}
......@@ -574,8 +574,8 @@ static av_always_inline void filter_mb_dir(H264Context *h, H264SliceContext *sl,
int b_idx= 8 + 4 + x + 8*y;
int bn_idx= b_idx - (dir ? 8:1);
if( h->non_zero_count_cache[b_idx] |
h->non_zero_count_cache[bn_idx] ) {
if (sl->non_zero_count_cache[b_idx] |
sl->non_zero_count_cache[bn_idx]) {
bS[i] = 2;
}
else if(!mv_done)
......@@ -657,8 +657,8 @@ static av_always_inline void filter_mb_dir(H264Context *h, H264SliceContext *sl,
int b_idx= 8 + 4 + x + 8*y;
int bn_idx= b_idx - (dir ? 8:1);
if( h->non_zero_count_cache[b_idx] |
h->non_zero_count_cache[bn_idx] ) {
if (sl->non_zero_count_cache[b_idx] |
sl->non_zero_count_cache[bn_idx]) {
bS[i] = 2;
}
else if(!mv_done)
......@@ -765,7 +765,7 @@ void ff_h264_filter_mb(H264Context *h, H264SliceContext *sl,
if( IS_INTRA( mbn_type ) )
bS[i] = 4;
else{
bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] |
bS[i] = 1 + !!(sl->non_zero_count_cache[12+8*(i>>1)] |
((!h->pps.cabac && IS_8x8DCT(mbn_type)) ?
(h->cbp_table[mbn_xy] & (((MB_FIELD(h) ? (i&2) : (mb_y&1)) ? 8 : 2) << 12))
:
......
......@@ -640,7 +640,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
(sl-> topleft_samples_available << i) & 0x8000,
(sl->topright_samples_available << i) & 0x4000, linesize);
} else {
const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
const int nnz = sl->non_zero_count_cache[scan8[i + p * 16]];
h->hpc.pred8x8l[dir](ptr, (sl->topleft_samples_available << i) & 0x8000,
(sl->topright_samples_available << i) & 0x4000, linesize);
if (nnz) {
......@@ -686,7 +686,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
topright = NULL;
h->hpc.pred4x4[dir](ptr, topright, linesize);
nnz = h->non_zero_count_cache[scan8[i + p * 16]];
nnz = sl->non_zero_count_cache[scan8[i + p * 16]];
if (nnz) {
if (is_h264) {
if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
......@@ -702,7 +702,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
} else {
h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize);
if (is_h264) {
if (h->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) {
if (sl->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) {
if (!transform_bypass)
h->h264dsp.h264_luma_dc_dequant_idct(h->mb + (p * 256 << pixel_shift),
h->mb_luma_dc[p],
......@@ -751,7 +751,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, H264SliceCon
linesize);
} else {
for (i = 0; i < 16; i++)
if (h->non_zero_count_cache[scan8[i + p * 16]] ||
if (sl->non_zero_count_cache[scan8[i + p * 16]] ||
dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
h->h264dsp.h264_add_pixels4_clear(dest_y + block_offset[i],
h->mb + (i * 16 + p * 256 << pixel_shift),
......@@ -761,7 +761,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, H264SliceCon
h->h264dsp.h264_idct_add16intra(dest_y, block_offset,
h->mb + (p * 256 << pixel_shift),
linesize,
h->non_zero_count_cache + p * 5 * 8);
sl->non_zero_count_cache + p * 5 * 8);
}
} else if (h->cbp & 15) {
if (transform_bypass) {
......@@ -769,7 +769,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, H264SliceCon
idct_add = IS_8x8DCT(mb_type) ? h->h264dsp.h264_add_pixels8_clear
: h->h264dsp.h264_add_pixels4_clear;
for (i = 0; i < 16; i += di)
if (h->non_zero_count_cache[scan8[i + p * 16]])
if (sl->non_zero_count_cache[scan8[i + p * 16]])
idct_add(dest_y + block_offset[i],
h->mb + (i * 16 + p * 256 << pixel_shift),
linesize);
......@@ -778,17 +778,17 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, H264SliceCon
h->h264dsp.h264_idct8_add4(dest_y, block_offset,
h->mb + (p * 256 << pixel_shift),
linesize,
h->non_zero_count_cache + p * 5 * 8);
sl->non_zero_count_cache + p * 5 * 8);
else
h->h264dsp.h264_idct_add16(dest_y, block_offset,
h->mb + (p * 256 << pixel_shift),
linesize,
h->non_zero_count_cache + p * 5 * 8);
sl->non_zero_count_cache + p * 5 * 8);
}
}
} else if (CONFIG_SVQ3_DECODER) {
for (i = 0; i < 16; i++)
if (h->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
if (sl->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
// FIXME benchmark weird rule, & below
uint8_t *const ptr = dest_y + block_offset[i];
ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize,
......
......@@ -209,14 +209,14 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
idct_add = h->h264dsp.h264_add_pixels4_clear;
for (j = 1; j < 3; j++) {
for (i = j * 16; i < j * 16 + 4; i++)
if (h->non_zero_count_cache[scan8[i]] ||
if (sl->non_zero_count_cache[scan8[i]] ||
dctcoef_get(h->mb, PIXEL_SHIFT, i * 16))
idct_add(dest[j - 1] + block_offset[i],
h->mb + (i * 16 << PIXEL_SHIFT),
uvlinesize);
if (chroma422) {
for (i = j * 16 + 4; i < j * 16 + 8; i++)
if (h->non_zero_count_cache[scan8[i + 4]] ||
if (sl->non_zero_count_cache[scan8[i + 4]] ||
dctcoef_get(h->mb, PIXEL_SHIFT, i * 16))
idct_add(dest[j - 1] + block_offset[i + 4],
h->mb + (i * 16 << PIXEL_SHIFT),
......@@ -234,15 +234,15 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
qp[0] = sl->chroma_qp[0];
qp[1] = sl->chroma_qp[1];
}
if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]])
if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]])
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 1 << PIXEL_SHIFT),
h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][qp[0]][0]);
if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]])
if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]])
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 2 << PIXEL_SHIFT),
h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][qp[1]][0]);
h->h264dsp.h264_idct_add8(dest, block_offset,
h->mb, uvlinesize,
h->non_zero_count_cache);
sl->non_zero_count_cache);
} else if (CONFIG_SVQ3_DECODER) {
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 1,
h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][sl->chroma_qp[0]][0]);
......@@ -250,7 +250,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][sl->chroma_qp[1]][0]);
for (j = 1; j < 3; j++) {
for (i = j * 16; i < j * 16 + 4; i++)
if (h->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) {
if (sl->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) {
uint8_t *const ptr = dest[j - 1] + block_offset[i];
ff_svq3_add_idct_c(ptr, h->mb + i * 16,
uvlinesize,
......
......@@ -539,7 +539,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
*/
/* FIXME: constraint_intra_pred & partitioning & nnz
* (let us hope this is just a typo in the spec) */
nnz_cache = h->non_zero_count_cache;
nnz_cache = sl->non_zero_count_cache;
if (top_type) {
nnz = h->non_zero_count[top_xy];
AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[4 * 3]);
......
......@@ -2207,7 +2207,7 @@ static int fill_filter_caches(H264Context *h, H264SliceContext *sl, int mb_type)
top_type, left_type, mb_xy, 1);
nnz = h->non_zero_count[mb_xy];
nnz_cache = h->non_zero_count_cache;
nnz_cache = sl->non_zero_count_cache;
AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
......
......@@ -691,7 +691,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
memset(sl->intra4x4_pred_mode + h->mb2br_xy[mb_xy], DC_PRED, 8);
}
if (!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B) {
memset(h->non_zero_count_cache + 8, 0, 14 * 8 * sizeof(uint8_t));
memset(sl->non_zero_count_cache + 8, 0, 14 * 8 * sizeof(uint8_t));
}
if (!IS_INTRA16x16(mb_type) &&
......@@ -733,7 +733,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
k = index ? (1 * (j & 1) + 2 * (i & 1) +
2 * (j & 2) + 4 * (i & 2))
: (4 * i + j);
h->non_zero_count_cache[scan8[k]] = 1;
sl->non_zero_count_cache[scan8[k]] = 1;
if (svq3_decode_block(&h->gb, &h->mb[16 * k], index, type)) {
av_log(h->avctx, AV_LOG_ERROR,
......@@ -755,7 +755,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
for (i = 1; i < 3; i++) {
for (j = 0; j < 4; j++) {
k = 16 * i + j;
h->non_zero_count_cache[scan8[k]] = 1;
sl->non_zero_count_cache[scan8[k]] = 1;
if (svq3_decode_block(&h->gb, &h->mb[16 * k], 1, 1)) {
av_log(h->avctx, AV_LOG_ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment