Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-22 16:17:59 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-03-22 16:39:32 +0300
commit563a8b4aac5d61657f49701b6cdb13b9ac6e7c9a (patch)
tree005833bbd49fcfc96585589da40d3e86f5bcacd5 /libavcodec/h264_cabac.c
parentaa65ff2adffa550fecf010a839ad2318e32e1875 (diff)
avcodec/h264_cabac: Drop local_ref_count
7966 -> 7897 decicycles This basically switches to the implementation from f6f7d1504134683c435e2c7d804279d982e52bb4 which seems faster Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r--libavcodec/h264_cabac.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 375cf90cef..11d0e32a8e 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1915,7 +1915,6 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
int dct8x8_allowed= h->pps.transform_8x8_mode;
int decode_chroma = h->sps.chroma_format_idc == 1 || h->sps.chroma_format_idc == 2;
const int pixel_shift = h->pixel_shift;
- unsigned local_ref_count[2];
mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
@@ -2057,9 +2056,6 @@ decode_intra_mb:
return 0;
}
- local_ref_count[0] = sl->ref_count[0] << MB_MBAFF(sl);
- local_ref_count[1] = sl->ref_count[1] << MB_MBAFF(sl);
-
fill_decode_caches(h, sl, mb_type);
if( IS_INTRA( mb_type ) ) {
@@ -2128,10 +2124,11 @@ decode_intra_mb:
for( i = 0; i < 4; i++ ) {
if(IS_DIRECT(sl->sub_mb_type[i])) continue;
if(IS_DIR(sl->sub_mb_type[i], 0, list)){
- if (local_ref_count[list] > 1) {
+ unsigned rc = sl->ref_count[list] << MB_MBAFF(sl);
+ if (rc > 1) {
ref[list][i] = decode_cabac_mb_ref(sl, list, 4 * i);
- if (ref[list][i] >= (unsigned)local_ref_count[list]) {
- av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], local_ref_count[list]);
+ if (ref[list][i] >= rc) {
+ av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], rc);
return -1;
}
}else
@@ -2214,10 +2211,11 @@ decode_intra_mb:
for (list = 0; list < sl->list_count; list++) {
if(IS_DIR(mb_type, 0, list)){
int ref;
- if (local_ref_count[list] > 1) {
+ unsigned rc = sl->ref_count[list] << MB_MBAFF(sl);
+ if (rc > 1) {
ref= decode_cabac_mb_ref(sl, list, 0);
- if (ref >= (unsigned)local_ref_count[list]) {
- av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, local_ref_count[list]);
+ if (ref >= rc) {
+ av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
return -1;
}
}else
@@ -2242,10 +2240,11 @@ decode_intra_mb:
for(i=0; i<2; i++){
if(IS_DIR(mb_type, i, list)){
int ref;
- if (local_ref_count[list] > 1) {
+ unsigned rc = sl->ref_count[list] << MB_MBAFF(sl);
+ if (rc > 1) {
ref= decode_cabac_mb_ref(sl, list, 8 * i);
- if (ref >= (unsigned)local_ref_count[list]) {
- av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, local_ref_count[list]);
+ if (ref >= rc) {
+ av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
return -1;
}
}else
@@ -2277,10 +2276,11 @@ decode_intra_mb:
for(i=0; i<2; i++){
if(IS_DIR(mb_type, i, list)){ //FIXME optimize
int ref;
- if (local_ref_count[list] > 1) {
+ unsigned rc = sl->ref_count[list] << MB_MBAFF(sl);
+ if (rc > 1) {
ref = decode_cabac_mb_ref(sl, list, 4 * i);
- if (ref >= (unsigned)local_ref_count[list]) {
- av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, local_ref_count[list]);
+ if (ref >= rc) {
+ av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
return -1;
}
}else