mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5'
* commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5':
h264: do not reinitialize the global cabac tables at each slice header
See: 1e2e2c8095
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
4a89868c5f
@ -139,6 +139,10 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
void ff_init_cabac_states(void)
|
||||
{
|
||||
int i, j;
|
||||
static int initialized = 0;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
for(i=0; i<64; i++){
|
||||
for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
|
||||
@ -163,6 +167,8 @@ void ff_init_cabac_states(void)
|
||||
for(i=0; i< 63; i++){
|
||||
ff_h264_last_coeff_flag_offset_8x8[i] = last_coeff_flag_offset_8x8[i];
|
||||
}
|
||||
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
|
@ -1593,6 +1593,8 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_h264_decode_init_vlc();
|
||||
|
||||
ff_init_cabac_states();
|
||||
|
||||
h->pixel_shift = 0;
|
||||
h->sps.bit_depth_luma = avctx->bits_per_raw_sample = 8;
|
||||
|
||||
@ -1629,7 +1631,6 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
|
||||
h->low_delay = 0;
|
||||
}
|
||||
|
||||
ff_init_cabac_states();
|
||||
avctx->internal->allocate_progress = 1;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user