Mercurial > libavcodec.hg
comparison h263.c @ 1663:4ac3573977e6 libavcodec
alternative inter vlc encoding fix
author | michael |
---|---|
date | Mon, 08 Dec 2003 02:23:22 +0000 |
parents | 4c9fd29f1606 |
children | b76ab3c968ab |
comparison
equal
deleted
inserted
replaced
1662:64c370fe6e88 | 1663:4ac3573977e6 |
---|---|
1977 j = s->intra_scantable.permutated[i]; | 1977 j = s->intra_scantable.permutated[i]; |
1978 level = block[j]; | 1978 level = block[j]; |
1979 if (level) { | 1979 if (level) { |
1980 run = i - last_non_zero - 1; | 1980 run = i - last_non_zero - 1; |
1981 last = (i == last_index); | 1981 last = (i == last_index); |
1982 | |
1983 if(level<0) level= -level; | |
1982 | 1984 |
1983 code = get_rl_index(rl, last, run, level); | 1985 code = get_rl_index(rl, last, run, level); |
1984 aic_code = get_rl_index(&rl_intra_aic, last, run, level); | 1986 aic_code = get_rl_index(&rl_intra_aic, last, run, level); |
1985 inter_vlc_bits += rl->table_vlc[code][1]+1; | 1987 inter_vlc_bits += rl->table_vlc[code][1]+1; |
1986 aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1; | 1988 aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1; |
1987 | 1989 |
1988 if (code == rl->n) { | 1990 if (code == rl->n) { |
1989 inter_vlc_bits += 1+6+8; | 1991 inter_vlc_bits += 1+6+8-1; |
1990 } | 1992 } |
1991 if (aic_code == rl_intra_aic.n) { | 1993 if (aic_code == rl_intra_aic.n) { |
1992 aic_vlc_bits += 1+6+8; | 1994 aic_vlc_bits += 1+6+8-1; |
1993 wrong_pos += run + 1; | 1995 wrong_pos += run + 1; |
1994 }else | 1996 }else |
1995 wrong_pos += wrong_run[aic_code]; | 1997 wrong_pos += wrong_run[aic_code]; |
1996 last_non_zero = i; | 1998 last_non_zero = i; |
1997 } | 1999 } |