Unified · Split
| @@ -106,7 +106,7 @@ typedef struct Plane { · 105 unmodified lines | |||
| 106 | typedef struct SliceArgs { | 106 | typedef struct SliceArgs { |
| 107 | PutBitContext pb; | 107 | PutBitContext pb; |
| 108 | int cache[DIRAC_MAX_QUANT_INDEX]; | 108 | int cache[DIRAC_MAX_QUANT_INDEX]; |
| 109 | struct VC2EncContext *ctx; | 109 | const struct VC2EncContext *ctx; |
| 110 | int x; | 110 | int x; |
| 111 | int y; | 111 | int y; |
| 112 | int quant_idx; | 112 | int quant_idx; |
| @@ -116,7 +116,7 @@ typedef struct SliceArgs { · 3 unmodified lines | |||
| 116 | } SliceArgs; | 116 | } SliceArgs; |
| 117 | 117 | ||
| 118 | typedef struct TransformArgs { | 118 | typedef struct TransformArgs { |
| 119 | struct VC2EncContext *ctx; | 119 | const struct VC2EncContext *ctx; |
| 120 | Plane *plane; | 120 | Plane *plane; |
| 121 | const void *idata; | 121 | const void *idata; |
| 122 | ptrdiff_t istride; | 122 | ptrdiff_t istride; |
| @@ -527,8 +527,8 @@ static void encode_picture_start(VC2EncContext *s) · 404 unmodified lines | |||
| 527 | #define QUANT(c, mul, add, shift) (((mul) * (c) + (add)) >> (shift)) | 527 | #define QUANT(c, mul, add, shift) (((mul) * (c) + (add)) >> (shift)) |
| 528 | 528 | ||
| 529 | /* VC-2 13.5.5.2 - slice_band() */ | 529 | /* VC-2 13.5.5.2 - slice_band() */ |
| 530 | static void encode_subband(VC2EncContext *s, PutBitContext *pb, int sx, int sy, | 530 | static void encode_subband(const VC2EncContext *s, PutBitContext *pb, |
| 531 | SubBand *b, int quant) | 531 | int sx, int sy, const SubBand *b, int quant) |
| 532 | { | 532 | { |
| 533 | int x, y; | 533 | int x, y; |
| 534 | 534 | ||
| @@ -558,7 +558,7 @@ static int count_hq_slice(SliceArgs *slice, int quant_idx) · 23 unmodified lines | |||
| 558 | int x, y; | 558 | int x, y; |
| 559 | uint8_t quants[MAX_DWT_LEVELS][4]; | 559 | uint8_t quants[MAX_DWT_LEVELS][4]; |
| 560 | int bits = 0, p, level, orientation; | 560 | int bits = 0, p, level, orientation; |
| 561 | VC2EncContext *s = slice->ctx; | 561 | const VC2EncContext *s = slice->ctx; |
| 562 | 562 | ||
| 563 | if (slice->cache[quant_idx]) | 563 | if (slice->cache[quant_idx]) |
| 564 | return slice->cache[quant_idx]; | 564 | return slice->cache[quant_idx]; |
| @@ -576,7 +576,7 @@ static int count_hq_slice(SliceArgs *slice, int quant_idx) · 11 unmodified lines | |||
| 576 | bits += 8; | 576 | bits += 8; |
| 577 | for (level = 0; level < s->wavelet_depth; level++) { | 577 | for (level = 0; level < s->wavelet_depth; level++) { |
| 578 | for (orientation = !!level; orientation < 4; orientation++) { | 578 | for (orientation = !!level; orientation < 4; orientation++) { |
| 579 | SubBand *b = &s->plane[p].band[level][orientation]; | 579 | const SubBand *b = &s->plane[p].band[level][orientation]; |
| 580 | 580 | ||
| 581 | const int q_idx = quants[level][orientation]; | 581 | const int q_idx = quants[level][orientation]; |
| 582 | const uint64_t q_m = ((uint64_t)s->qmagic_lut[q_idx][0]) << 2; | 582 | const uint64_t q_m = ((uint64_t)s->qmagic_lut[q_idx][0]) << 2; |
| @@ -618,7 +618,7 @@ static int count_hq_slice(SliceArgs *slice, int quant_idx) · 35 unmodified lines | |||
| 618 | static int rate_control(AVCodecContext *avctx, void *arg) | 618 | static int rate_control(AVCodecContext *avctx, void *arg) |
| 619 | { | 619 | { |
| 620 | SliceArgs *slice_dat = arg; | 620 | SliceArgs *slice_dat = arg; |
| 621 | VC2EncContext *s = slice_dat->ctx; | 621 | const VC2EncContext *s = slice_dat->ctx; |
| 622 | const int top = slice_dat->bits_ceil; | 622 | const int top = slice_dat->bits_ceil; |
| 623 | const int bottom = slice_dat->bits_floor; | 623 | const int bottom = slice_dat->bits_floor; |
| 624 | int quant_buf[2] = {-1, -1}; | 624 | int quant_buf[2] = {-1, -1}; |
| @@ -724,7 +724,7 @@ static int calc_slice_sizes(VC2EncContext *s) · 99 unmodified lines | |||
| 724 | static int encode_hq_slice(AVCodecContext *avctx, void *arg) | 724 | static int encode_hq_slice(AVCodecContext *avctx, void *arg) |
| 725 | { | 725 | { |
| 726 | SliceArgs *slice_dat = arg; | 726 | SliceArgs *slice_dat = arg; |
| 727 | VC2EncContext *s = slice_dat->ctx; | 727 | const VC2EncContext *s = slice_dat->ctx; |
| 728 | PutBitContext *pb = &slice_dat->pb; | 728 | PutBitContext *pb = &slice_dat->pb; |
| 729 | const int slice_x = slice_dat->x; | 729 | const int slice_x = slice_dat->x; |
| 730 | const int slice_y = slice_dat->y; | 730 | const int slice_y = slice_dat->y; |
| @@ -839,7 +839,7 @@ static int encode_slices(VC2EncContext *s) · 108 unmodified lines | |||
| 839 | static int dwt_plane(AVCodecContext *avctx, void *arg) | 839 | static int dwt_plane(AVCodecContext *avctx, void *arg) |
| 840 | { | 840 | { |
| 841 | TransformArgs *transform_dat = arg; | 841 | TransformArgs *transform_dat = arg; |
| 842 | VC2EncContext *s = transform_dat->ctx; | 842 | const VC2EncContext *s = transform_dat->ctx; |
| 843 | const void *frame_data = transform_dat->idata; | 843 | const void *frame_data = transform_dat->idata; |
| 844 | const ptrdiff_t linesize = transform_dat->istride; | 844 | const ptrdiff_t linesize = transform_dat->istride; |
| 845 | const int field = transform_dat->field; | 845 | const int field = transform_dat->field; |