The chroma pointers ac_val[1] and ac_val[2] are no longer used anywhere.
Showing the changes to libavcodec (8 of 8 files). Show all
Unified · Split
| @@ -451,7 +451,7 @@ static void h263_pred_acdc(MpegEncContext * s, int16_t *block, int n) · 450 unmodified lines | ||
| 451 | 451 | int wrap, a, c, pred_dc, scale; |
| 452 | 452 | const int xy = s->block_index[n]; |
| 453 | 453 | int16_t *const dc_val = s->dc_val[0] + xy; |
| 454 | − int16_t *const ac_val = (s->ac_val[0] + xy)[0]; | |
| 454 | + int16_t *const ac_val = (s->ac_val + xy)[0]; | |
| 455 | 455 | |
| 456 | 456 | /* find prediction */ |
| 457 | 457 | if (n < 4) { |
| @@ -50,11 +50,13 @@ void ff_mpeg4_clean_buffers(MpegEncContext *s) · 49 unmodified lines | ||
| 50 | 50 | l_xy = (2 * s->mb_y - 1) * l_wrap + s->mb_x * 2 - 1; |
| 51 | 51 | c_wrap = s->mb_stride; |
| 52 | 52 | int u_xy = 2 * mb_height * l_wrap + s->mb_y * c_wrap + s->mb_x - 1; |
| 53 | + int v_xy = u_xy + c_wrap * (mb_height + 1); | |
| 54 | + int16_t (*ac_val)[16] = s->ac_val; | |
| 53 | 55 | |
| 54 | 56 | /* clean AC */ |
| 55 | − memset(s->ac_val[0] + l_xy, 0, (l_wrap * 2 + 1) * 16 * sizeof(int16_t)); | |
| 56 | − memset(s->ac_val[0] + u_xy, 0, (c_wrap + 1) * 16 * sizeof(int16_t)); | |
| 57 | − memset(s->ac_val[0] + u_xy + c_wrap * (mb_height + 1), 0, (c_wrap + 1) * 16 * sizeof(int16_t)); | |
| 57 | + memset(ac_val + l_xy, 0, (l_wrap * 2 + 1) * sizeof(*ac_val)); | |
| 58 | + memset(ac_val + u_xy, 0, (c_wrap + 1) * sizeof(*ac_val)); | |
| 59 | + memset(ac_val + v_xy, 0, (c_wrap + 1) * sizeof(*ac_val)); | |
| 58 | 60 | |
| 59 | 61 | /* clean MV */ |
| 60 | 62 | // we can't clear the MVs as they might be needed by a B-frame |
| @@ -326,7 +326,7 @@ void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, int dir) · 325 unmodified lines | ||
| 326 | 326 | int8_t *const qscale_table = s->cur_pic.qscale_table; |
| 327 | 327 | |
| 328 | 328 | /* find prediction */ |
| 329 | − ac_val = &s->ac_val[0][0][0] + s->block_index[n] * 16; | |
| 329 | + ac_val = &s->ac_val[0][0] + s->block_index[n] * 16; | |
| 330 | 330 | ac_val1 = ac_val; |
| 331 | 331 | if (s->ac_pred) { |
| 332 | 332 | if (dir == 0) { |
| @@ -3785,9 +3785,7 @@ static av_cold void clear_context(MpegEncContext *s) · 3452 unmodified lines | ||
| 3785 | 3785 | s->block = NULL; |
| 3786 | 3786 | s->blocks = NULL; |
| 3787 | 3787 | s->ac_val_base = NULL; |
| 3788 | − s->ac_val[0] = | |
| 3789 | − s->ac_val[1] = | |
| 3790 | − s->ac_val[2] =NULL; | |
| 3788 | + s->ac_val = NULL; | |
| 3791 | 3789 | memset(&s->sc, 0, sizeof(s->sc)); |
| 3792 | 3790 | |
| 3793 | 3791 | s->p_field_mv_table_base = NULL; |
| @@ -130,7 +130,7 @@ static inline void restore_ac_coeffs(MPVEncContext *const s, int16_t block[6][64 · 129 unmodified lines | ||
| 130 | 130 | memcpy(s->c.block_last_index, zigzag_last_index, sizeof(int) * 6); |
| 131 | 131 | |
| 132 | 132 | for (n = 0; n < 6; n++) { |
| 133 | − int16_t *ac_val = &s->c.ac_val[0][0][0] + s->c.block_index[n] * 16; | |
| 133 | + int16_t *ac_val = &s->c.ac_val[0][0] + s->c.block_index[n] * 16; | |
| 134 | 134 | |
| 135 | 135 | st[n] = s->c.intra_scantable.permutated; |
| 136 | 136 | if (dir[n]) { |
| @@ -169,7 +169,7 @@ static inline int decide_ac_pred(MPVEncContext *const s, int16_t block[6][64], · 32 unmodified lines | ||
| 169 | 169 | score -= get_block_rate(s, block[n], s->c.block_last_index[n], |
| 170 | 170 | s->c.intra_scantable.permutated); |
| 171 | 171 | |
| 172 | − ac_val = &s->c.ac_val[0][0][0] + s->c.block_index[n] * 16; | |
| 172 | + ac_val = &s->c.ac_val[0][0] + s->c.block_index[n] * 16; | |
| 173 | 173 | ac_val1 = ac_val; |
| 174 | 174 | if (dir[n]) { |
| 175 | 175 | const int xy = s->c.mb_x + s->c.mb_y * s->c.mb_stride - s->c.mb_stride; |
| @@ -129,9 +129,7 @@ static av_cold int init_duplicate_context(MpegEncContext *s) · 128 unmodified lines | ||
| 129 | 129 | /* ac values */ |
| 130 | 130 | if (!FF_ALLOCZ_TYPED_ARRAY(s->ac_val_base, yc_size)) |
| 131 | 131 | return AVERROR(ENOMEM); |
| 132 | − s->ac_val[0] = s->ac_val_base + s->b8_stride + 1; | |
| 133 | − s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1; | |
| 134 | − s->ac_val[2] = s->ac_val[1] + c_size; | |
| 132 | + s->ac_val = s->ac_val_base + s->b8_stride + 1; | |
| 135 | 133 | } |
| 136 | 134 | |
| 137 | 135 | return 0; |
| @@ -195,9 +193,7 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src) · 57 unmodified lines | ||
| 195 | 193 | COPY(start_mb_y); |
| 196 | 194 | COPY(end_mb_y); |
| 197 | 195 | COPY(ac_val_base); |
| 198 | − COPY(ac_val[0]); | |
| 199 | − COPY(ac_val[1]); | |
| 200 | − COPY(ac_val[2]); | |
| 196 | + COPY(ac_val); | |
| 201 | 197 | #undef COPY |
| 202 | 198 | } |
| 203 | 199 | |
| @@ -502,7 +498,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) · 298 unmodified lines | ||
| 502 | 498 | dc_val[uxy] = |
| 503 | 499 | dc_val[vxy] = 1024; |
| 504 | 500 | /* ac pred */ |
| 505 | − int16_t (*ac_val)[16] = s->ac_val[0]; | |
| 501 | + int16_t (*ac_val)[16] = s->ac_val; | |
| 506 | 502 | av_assume(!((uintptr_t)ac_val & 0xF)); |
| 507 | 503 | // Don't reset the upper-left luma block, as it will only ever be |
| 508 | 504 | // referenced by blocks from the same macroblock. |
| @@ -148,7 +148,7 @@ typedef struct MpegEncContext { · 147 unmodified lines | ||
| 148 | 148 | uint8_t *coded_block_base; |
| 149 | 149 | uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1) |
| 150 | 150 | int16_t (*ac_val_base)[16]; |
| 151 | − int16_t (*ac_val[3])[16]; ///< used for MPEG-4 AC prediction, all 3 arrays must be continuous | |
| 151 | + int16_t (*ac_val)[16]; ///< used for H.263 AIC, MPEG-4 AC prediction | |
| 152 | 152 | int mb_skipped; ///< MUST BE SET only during DECODING |
| 153 | 153 | uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example) |
| 154 | 154 | and used for B-frame encoding & decoding (contains skip table of next P-frame) */ |
| @@ -3327,7 +3327,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3326 unmodified lines | ||
| 3327 | 3327 | if(storecoefs){ |
| 3328 | 3328 | for(i=0; i<6; i++){ |
| 3329 | 3329 | dc[i] = s->c.dc_val[0][s->c.block_index[i]]; |
| 3330 | − memcpy(ac[i], s->c.ac_val[0][s->c.block_index[i]], sizeof(int16_t)*16); | |
| 3330 | + memcpy(ac[i], s->c.ac_val[s->c.block_index[i]], sizeof(*s->c.ac_val)); | |
| 3331 | 3331 | } |
| 3332 | 3332 | } |
| 3333 | 3333 | |
| @@ -3337,7 +3337,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3 unmodified lines | ||
| 3337 | 3337 | if(storecoefs){ |
| 3338 | 3338 | for(i=0; i<6; i++){ |
| 3339 | 3339 | s->c.dc_val[0][s->c.block_index[i]] = dc[i]; |
| 3340 | − memcpy(s->c.ac_val[0][s->c.block_index[i]], ac[i], sizeof(int16_t)*16); | |
| 3340 | + memcpy(s->c.ac_val[s->c.block_index[i]], ac[i], sizeof(*s->c.ac_val)); | |
| 3341 | 3341 | } |
| 3342 | 3342 | } |
| 3343 | 3343 | } |
| @@ -611,7 +611,7 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 610 unmodified lines | ||
| 611 | 611 | /* Store the quantized DC coeff, used for prediction */ |
| 612 | 612 | block[0] = dcdiff * s->y_dc_scale; |
| 613 | 613 | |
| 614 | − ac_val = s->ac_val[0][s->block_index[n]]; | |
| 614 | + ac_val = s->ac_val[s->block_index[n]]; | |
| 615 | 615 | ac_val2 = ac_val; |
| 616 | 616 | if (dc_pred_dir) // left |
| 617 | 617 | ac_val -= 16; |
| @@ -750,7 +750,7 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 132 unmodified lines | ||
| 750 | 750 | |
| 751 | 751 | scale = quant * 2 + ((mquant < 0) ? 0 : v->halfpq); |
| 752 | 752 | |
| 753 | − ac_val = s->ac_val[0][s->block_index[n]]; | |
| 753 | + ac_val = s->ac_val[s->block_index[n]]; | |
| 754 | 754 | ac_val2 = ac_val; |
| 755 | 755 | if (dc_pred_dir) // left |
| 756 | 756 | ac_val -= 16; |
| @@ -938,7 +938,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 181 unmodified lines | ||
| 938 | 938 | if (!a_avail) dc_pred_dir = 1; |
| 939 | 939 | if (!c_avail) dc_pred_dir = 0; |
| 940 | 940 | if (!a_avail && !c_avail) use_pred = 0; |
| 941 | − ac_val = s->ac_val[0][s->block_index[n]]; | |
| 941 | + ac_val = s->ac_val[s->block_index[n]]; | |
| 942 | 942 | ac_val2 = ac_val; |
| 943 | 943 | |
| 944 | 944 | scale = quant * 2 + ((mquant < 0) ? 0 : v->halfpq); |