Commit 250430bf authored by Mickaël Raulet's avatar Mickaël Raulet Committed by Michael Niedermayer

hevc: separate residu and prediction (needed for Range Extension)

(cherry picked from commit 6b3856ef57d66f2e59ee61fd2eb5f83b6d0d7d4a)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 255086a7
......@@ -1383,17 +1383,15 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
}
}
if (lc->cu.cu_transquant_bypass_flag) {
s->hevcdsp.transquant_bypass[log2_trafo_size-2](dst, coeffs, stride);
} else {
if (!lc->cu.cu_transquant_bypass_flag) {
if (transform_skip_flag)
s->hevcdsp.transform_skip(dst, coeffs, stride);
s->hevcdsp.transform_skip(coeffs, log2_trafo_size);
else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 && log2_trafo_size == 2)
s->hevcdsp.transform_4x4_luma_add(dst, coeffs, stride);
s->hevcdsp.idct_4x4_luma(coeffs);
else {
int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y);
if (max_xy == 0)
s->hevcdsp.transform_dc_add[log2_trafo_size-2](dst, coeffs, stride);
s->hevcdsp.idct_dc[log2_trafo_size-2](coeffs);
else {
int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4;
if (max_xy < 4)
......@@ -1402,10 +1400,11 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
col_limit = FFMIN(8, col_limit);
else if (max_xy < 12)
col_limit = FFMIN(24, col_limit);
s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride, col_limit);
s->hevcdsp.idct[log2_trafo_size-2](coeffs, col_limit);
}
}
}
s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride);
}
void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size)
......
......@@ -191,21 +191,21 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
#define HEVC_DSP(depth) \
hevcdsp->put_pcm = FUNC(put_pcm, depth); \
hevcdsp->transquant_bypass[0] = FUNC(transquant_bypass4x4, depth); \
hevcdsp->transquant_bypass[1] = FUNC(transquant_bypass8x8, depth); \
hevcdsp->transquant_bypass[2] = FUNC(transquant_bypass16x16, depth); \
hevcdsp->transquant_bypass[3] = FUNC(transquant_bypass32x32, depth); \
hevcdsp->transform_add[0] = FUNC(transform_add4x4, depth); \
hevcdsp->transform_add[1] = FUNC(transform_add8x8, depth); \
hevcdsp->transform_add[2] = FUNC(transform_add16x16, depth); \
hevcdsp->transform_add[3] = FUNC(transform_add32x32, depth); \
hevcdsp->transform_skip = FUNC(transform_skip, depth); \
hevcdsp->transform_4x4_luma_add = FUNC(transform_4x4_luma_add, depth); \
hevcdsp->transform_add[0] = FUNC(transform_4x4_add, depth); \
hevcdsp->transform_add[1] = FUNC(transform_8x8_add, depth); \
hevcdsp->transform_add[2] = FUNC(transform_16x16_add, depth); \
hevcdsp->transform_add[3] = FUNC(transform_32x32_add, depth); \
hevcdsp->idct_4x4_luma = FUNC(transform_4x4_luma, depth); \
hevcdsp->idct[0] = FUNC(idct_4x4, depth); \
hevcdsp->idct[1] = FUNC(idct_8x8, depth); \
hevcdsp->idct[2] = FUNC(idct_16x16, depth); \
hevcdsp->idct[3] = FUNC(idct_32x32, depth); \
\
hevcdsp->transform_dc_add[0] = FUNC(transform_4x4_dc_add, depth); \
hevcdsp->transform_dc_add[1] = FUNC(transform_8x8_dc_add, depth); \
hevcdsp->transform_dc_add[2] = FUNC(transform_16x16_dc_add, depth); \
hevcdsp->transform_dc_add[3] = FUNC(transform_32x32_dc_add, depth); \
hevcdsp->idct_dc[0] = FUNC(idct_4x4_dc, depth); \
hevcdsp->idct_dc[1] = FUNC(idct_8x8_dc, depth); \
hevcdsp->idct_dc[2] = FUNC(idct_16x16_dc, depth); \
hevcdsp->idct_dc[3] = FUNC(idct_32x32_dc, depth); \
\
hevcdsp->sao_band_filter = FUNC(sao_band_filter_0, depth); \
hevcdsp->sao_edge_filter[0] = FUNC(sao_edge_filter_0, depth); \
......
......@@ -44,13 +44,15 @@ typedef struct HEVCDSPContext {
void (*put_pcm)(uint8_t *dst, ptrdiff_t stride, int size,
GetBitContext *gb, int pcm_bit_depth);
void (*transquant_bypass[4])(uint8_t *dst, int16_t *coeffs,
ptrdiff_t stride);
void (*transform_add[4])(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stride);
void (*transform_skip)(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
void (*transform_4x4_luma_add)(uint8_t *dst, int16_t *coeffs,
ptrdiff_t stride);
void (*transform_add[4])(uint8_t *dst, int16_t *coeffs, ptrdiff_t _stride, int col_limit);
void (*transform_skip)(int16_t *coeffs, int16_t log2_size);
void (*idct_4x4_luma)(int16_t *coeffs);
void (*idct[4])(int16_t *coeffs, int col_limit);
void (*idct_dc[4])(int16_t *coeffs);
void (*transform_dc_add[4])(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment