This makes the function closer to encode_dcs() in proresenc_kostya.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -272,7 +272,7 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks, · 271 unmodified lines | ||
| 272 | 272 | { |
| 273 | 273 | int prev_dc, codebook; |
| 274 | 274 | int i, sign, new_sign; |
| 275 | − int new_dc, delta, diff_sign, code; | |
| 275 | + int dc, delta, diff_sign, code; | |
| 276 | 276 | |
| 277 | 277 | prev_dc = (blocks[0] - 0x4000) / qmat[0]; |
| 278 | 278 | codebook = TO_GOLOMB(prev_dc); |
| @@ -281,8 +281,8 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks, · 2 unmodified lines | ||
| 281 | 281 | |
| 282 | 282 | codebook = 5; sign = 0; |
| 283 | 283 | for (i = 1; i < blocks_per_slice; i++, blocks += 64) { |
| 284 | − new_dc = (blocks[0] - 0x4000) / qmat[0]; | |
| 285 | − delta = new_dc - prev_dc; | |
| 284 | + dc = (blocks[0] - 0x4000) / qmat[0]; | |
| 285 | + delta = dc - prev_dc; | |
| 286 | 286 | new_sign = GET_SIGN(delta); |
| 287 | 287 | diff_sign = new_sign ^ sign; |
| 288 | 288 | code = TO_GOLOMB2(get_level(delta), diff_sign); |
| @@ -291,7 +291,7 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks, · 2 unmodified lines | ||
| 291 | 291 | |
| 292 | 292 | codebook = FFMIN(code, 6); |
| 293 | 293 | sign = new_sign; |
| 294 | − prev_dc = new_dc; | |
| 294 | + prev_dc = dc; | |
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |