"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavcodec/h264_cabac.c" between
libav-12.1.tar.gz and libav-12.2.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

h264_cabac.c  (libav-12.1):h264_cabac.c  (libav-12.2)
skipping to change at line 2332 skipping to change at line 2332
if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) { if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline(&sl->cabac, &sl->cabac_st ate[399 + sl->neighbor_transform_size]); mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline(&sl->cabac, &sl->cabac_st ate[399 + sl->neighbor_transform_size]);
} }
/* It would be better to do this in fill_decode_caches, but we don't know /* It would be better to do this in fill_decode_caches, but we don't know
* the transform mode of the current macroblock there. */ * the transform mode of the current macroblock there. */
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* 6 + 2*8*i]= nnz_cache[3+8* 1 + 2*8*i]=
nnz_cache[3+8* 7 + 2*8*i]= nnz_cache[3+8* 2 + 2*8*i]=
nnz_cache[3+8*11 + 2*8*i]= nnz_cache[3+8* 6 + 2*8*i]=
nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0; 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(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 : 0x4040404
0;
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 = !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;
if( cbp || IS_INTRA16x16( mb_type ) ) { if( cbp || IS_INTRA16x16( mb_type ) ) {
const uint8_t *scan, *scan8x8; const uint8_t *scan, *scan8x8;
const uint32_t *qmul; const uint32_t *qmul;
if(IS_INTERLACED(mb_type)){
scan8x8 = sl->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
scan = sl->qscale ? h->field_scan : h->field_scan_q0;
}else{
scan8x8 = sl->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
}
// decode_cabac_mb_dqp // decode_cabac_mb_dqp
if(get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + (sl->last_qscal e_diff != 0)])){ if(get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + (sl->last_qscal e_diff != 0)])){
int val = 1; int val = 1;
int ctx= 2; int ctx= 2;
const int max_qp = 51 + 6*(sps->bit_depth_luma-8); const int max_qp = 51 + 6*(sps->bit_depth_luma-8);
while( get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + ctx] ) ) { while( get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + ctx] ) ) {
ctx= 3; ctx= 3;
val++; val++;
if(val > 2*max_qp){ //prevent infinite loop if(val > 2*max_qp){ //prevent infinite loop
skipping to change at line 2393 skipping to change at line 2404
sl->qscale += val; sl->qscale += val;
if (((unsigned)sl->qscale) > max_qp){ if (((unsigned)sl->qscale) > max_qp){
if (sl->qscale < 0) sl->qscale += max_qp + 1; if (sl->qscale < 0) sl->qscale += max_qp + 1;
else sl->qscale -= max_qp + 1; else sl->qscale -= max_qp + 1;
} }
sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale); sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale);
sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale); sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale);
}else }else
sl->last_qscale_diff=0; sl->last_qscale_diff=0;
if(IS_INTERLACED(mb_type)){
scan8x8 = sl->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
scan = sl->qscale ? h->field_scan : h->field_scan_q0;
}else{
scan8x8 = sl->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
}
decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, c bp, 0); decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, c bp, 0);
if (CHROMA444(h)) { if (CHROMA444(h)) {
decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_typ e, cbp, 1); decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_typ e, cbp, 1);
decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_typ e, cbp, 2); decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_typ e, cbp, 2);
} else if (CHROMA422(h)) { } else if (CHROMA422(h)) {
if( cbp&0x30 ){ if( cbp&0x30 ){
int c; int c;
for (c = 0; c < 2; c++) for (c = 0; c < 2; c++)
decode_cabac_residual_dc_422(h, sl, sl->mb + ((256 + 16*16*c ) << pixel_shift), 3, decode_cabac_residual_dc_422(h, sl, sl->mb + ((256 + 16*16*c ) << pixel_shift), 3,
CHROMA_DC_BLOCK_INDEX + c, CHROMA_DC_BLOCK_INDEX + c,
 End of changes. 4 change blocks. 
22 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)