You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
hevc: Add DC IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
This commit is contained in:
committed by
Luca Barbato
parent
4f247de3b7
commit
a92fd8a062
@@ -1214,9 +1214,14 @@ static void hls_residual_coding(HEVCContext *s, int x0, int y0,
|
|||||||
else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 &&
|
else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 &&
|
||||||
log2_trafo_size == 2)
|
log2_trafo_size == 2)
|
||||||
s->hevcdsp.transform_4x4_luma(coeffs);
|
s->hevcdsp.transform_4x4_luma(coeffs);
|
||||||
|
else {
|
||||||
|
int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y);
|
||||||
|
if (max_xy == 0)
|
||||||
|
s->hevcdsp.idct_dc[log2_trafo_size - 2](coeffs);
|
||||||
else
|
else
|
||||||
s->hevcdsp.idct[log2_trafo_size - 2](coeffs);
|
s->hevcdsp.idct[log2_trafo_size - 2](coeffs);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
s->hevcdsp.add_residual[log2_trafo_size - 2](dst, coeffs, stride);
|
s->hevcdsp.add_residual[log2_trafo_size - 2](dst, coeffs, stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -175,6 +175,10 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
|
|||||||
hevcdsp->idct[2] = FUNC(idct_16x16, depth); \
|
hevcdsp->idct[2] = FUNC(idct_16x16, depth); \
|
||||||
hevcdsp->idct[3] = FUNC(idct_32x32, depth); \
|
hevcdsp->idct[3] = FUNC(idct_32x32, 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[0] = FUNC(sao_band_filter_0, depth); \
|
hevcdsp->sao_band_filter[0] = FUNC(sao_band_filter_0, depth); \
|
||||||
hevcdsp->sao_band_filter[1] = FUNC(sao_band_filter_1, depth); \
|
hevcdsp->sao_band_filter[1] = FUNC(sao_band_filter_1, depth); \
|
||||||
hevcdsp->sao_band_filter[2] = FUNC(sao_band_filter_2, depth); \
|
hevcdsp->sao_band_filter[2] = FUNC(sao_band_filter_2, depth); \
|
||||||
|
@@ -47,6 +47,7 @@ typedef struct HEVCDSPContext {
|
|||||||
void (*dequant)(int16_t *coeffs);
|
void (*dequant)(int16_t *coeffs);
|
||||||
void (*transform_4x4_luma)(int16_t *coeffs);
|
void (*transform_4x4_luma)(int16_t *coeffs);
|
||||||
void (*idct[4])(int16_t *coeffs);
|
void (*idct[4])(int16_t *coeffs);
|
||||||
|
void (*idct_dc[4])(int16_t *coeffs);
|
||||||
|
|
||||||
void (*sao_band_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
void (*sao_band_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||||
struct SAOParams *sao, int *borders,
|
struct SAOParams *sao, int *borders,
|
||||||
|
@@ -223,10 +223,29 @@ static void FUNC(idct_ ## H ## x ## H )(int16_t *coeffs) \
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define IDCT_DC(H) \
|
||||||
|
static void FUNC(idct_ ## H ## x ## H ## _dc)(int16_t *coeffs) \
|
||||||
|
{ \
|
||||||
|
int i, j; \
|
||||||
|
int shift = 14 - BIT_DEPTH; \
|
||||||
|
int add = 1 << (shift - 1); \
|
||||||
|
int coeff = (((coeffs[0] + 1) >> 1) + add) >> shift; \
|
||||||
|
\
|
||||||
|
for (j = 0; j < H; j++) { \
|
||||||
|
for (i = 0; i < H; i++) { \
|
||||||
|
coeffs[i + j * H] = coeff; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
IDCT( 4)
|
IDCT( 4)
|
||||||
IDCT( 8)
|
IDCT( 8)
|
||||||
IDCT(16)
|
IDCT(16)
|
||||||
IDCT(32)
|
IDCT(32)
|
||||||
|
IDCT_DC( 4)
|
||||||
|
IDCT_DC( 8)
|
||||||
|
IDCT_DC(16)
|
||||||
|
IDCT_DC(32)
|
||||||
#undef TR_4
|
#undef TR_4
|
||||||
#undef TR_8
|
#undef TR_8
|
||||||
#undef TR_16
|
#undef TR_16
|
||||||
|
Reference in New Issue
Block a user