diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-05-29 16:51:55 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-05-29 16:51:55 +0000 |
commit | 1e6b5700872f6c2729d621ef8e10c1a2873eefd4 (patch) | |
tree | 39476cfead842a0cbe00f264a0fe1812cfb87da4 /libavcodec/snow.c | |
parent | 3dba31aa0d5f0fdca5c002cea9c0757a90ec21f0 (diff) | |
download | ffmpeg-1e6b5700872f6c2729d621ef8e10c1a2873eefd4.tar.gz |
fix assertion failure
Originally committed as revision 9152 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r-- | libavcodec/snow.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c index df32d12632..fddffc1e75 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -1989,7 +1989,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ RangeCoder pc, ic; uint8_t *pbbak= s->c.bytestream; uint8_t *pbbak_start= s->c.bytestream_start; - int score, score2, iscore, i_len, p_len, block_s, sum; + int score, score2, iscore, i_len, p_len, block_s, sum, base_bits; const int w= s->b_width << s->block_max_depth; const int h= s->b_height << s->block_max_depth; const int rem_depth= s->block_max_depth - level; @@ -2115,6 +2115,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ //FIXME if mb_cmp != SSE then intra cant be compared currently and mb_penalty vs. lambda2 // subpel search + base_bits= get_rac_count(&s->c) - (s->c.bytestream - s->c.bytestream_start); pc= s->c; pc.bytestream_start= pc.bytestream= p_buffer; //FIXME end/start? and at the other stoo @@ -2129,10 +2130,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&pc, &p_state[128 + 32*(mx_context + 16*!!best_ref)], mx - pmx, 1); put_symbol(&pc, &p_state[128 + 32*(my_context + 16*!!best_ref)], my - pmy, 1); p_len= pc.bytestream - pc.bytestream_start; - score += (s->lambda2*(p_len*8 - + (pc.outstanding_count - s->c.outstanding_count)*8 - + (-av_log2(pc.range) + av_log2(s->c.range)) - ))>>FF_LAMBDA_SHIFT; + score += (s->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; block_s= block_w*block_w; sum = pix_sum(current_data[0], stride, block_w); @@ -2158,10 +2156,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&ic, &i_state[64], cb-pcb, 1); put_symbol(&ic, &i_state[96], cr-pcr, 1); i_len= ic.bytestream - ic.bytestream_start; - iscore += (s->lambda2*(i_len*8 - + (ic.outstanding_count - s->c.outstanding_count)*8 - + (-av_log2(ic.range) + av_log2(s->c.range)) - ))>>FF_LAMBDA_SHIFT; + iscore += (s->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; // assert(score==256*256*256*64-1); assert(iscore < 255*255*256 + s->lambda2*10); |