summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-10-26 23:00:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-10-26 23:00:49 +0000
commit349d72870f403b884aba08da7be1ce66e72ad39f (patch)
treeb759747035d4e345b221c81d4b7578c8efc9559d /libavcodec/ffv1.c
parent5dd97520762a1a18e0fc2131f45ece252ee6b849 (diff)
Make 1pass statistic collection in ffv1 put_symbol_inline() conditional to avoid slowdown when more statistic collection code is added.
Originally committed as revision 25577 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 3da38dc27c..0f1433b1d5 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -304,7 +304,9 @@ static av_always_inline av_flatten void put_symbol_inline(RangeCoder *c, uint8_t
#define put_rac(C,S,B) \
do{\
+ if(rc_stat){\
rc_stat[*(S)][B]++;\
+ }\
put_rac(C,S,B);\
}while(0)
@@ -344,8 +346,7 @@ do{\
}
static void av_noinline put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){
- uint64_t rc_stat[256][2]; //we dont bother counting header bits.
- put_symbol_inline(c, state, v, is_signed, rc_stat);
+ put_symbol_inline(c, state, v, is_signed, NULL);
}
static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed){
@@ -493,7 +494,11 @@ static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sam
diff= fold(diff, bits);
if(s->ac){
+ if(s->flags & CODEC_FLAG_PASS1){
put_symbol_inline(c, p->state[context], diff, 1, s->rc_stat);
+ }else{
+ put_symbol_inline(c, p->state[context], diff, 1, NULL);
+ }
}else{
if(context == 0) run_mode=1;