You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/vvc/intra: add ff_vvc_palette_derive_scale
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit is contained in:
@ -336,9 +336,6 @@ static void derive_qp(const VVCLocalContext *lc, const TransformUnit *tu, Transf
|
|||||||
tb->bd_offset = (1 << tb->bd_shift) >> 1;
|
tb->bd_offset = (1 << tb->bd_shift) >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//8.7.3 Scaling process for transform coefficients
|
|
||||||
static av_always_inline int derive_scale(const TransformBlock *tb, const int sh_dep_quant_used_flag)
|
|
||||||
{
|
|
||||||
static const uint8_t rem6[63 + 8 * 6 + 1] = {
|
static const uint8_t rem6[63 + 8 * 6 + 1] = {
|
||||||
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
|
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
|
||||||
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
|
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
|
||||||
@ -359,6 +356,10 @@ static av_always_inline int derive_scale(const TransformBlock *tb, const int sh_
|
|||||||
{ 40, 45, 51, 57, 64, 72 },
|
{ 40, 45, 51, 57, 64, 72 },
|
||||||
{ 57, 64, 72, 80, 90, 102 }
|
{ 57, 64, 72, 80, 90, 102 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//8.7.3 Scaling process for transform coefficients
|
||||||
|
static av_always_inline int derive_scale(const TransformBlock *tb, const int sh_dep_quant_used_flag)
|
||||||
|
{
|
||||||
const int addin = sh_dep_quant_used_flag && !tb->ts;
|
const int addin = sh_dep_quant_used_flag && !tb->ts;
|
||||||
const int qp = tb->qp + addin;
|
const int qp = tb->qp + addin;
|
||||||
|
|
||||||
@ -658,6 +659,17 @@ static void ibc_fill_vir_buf(const VVCLocalContext *lc, const CodingUnit *cu)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ff_vvc_palette_derive_scale(VVCLocalContext *lc, const TransformUnit *tu, TransformBlock *tb)
|
||||||
|
{
|
||||||
|
const VVCSPS *sps = lc->fc->ps.sps;
|
||||||
|
const int qp_prime_ts_min = 4 + 6 * sps->r->sps_min_qp_prime_ts;
|
||||||
|
int qp;
|
||||||
|
|
||||||
|
derive_qp(lc, tu, tb);
|
||||||
|
qp = FFMAX(qp_prime_ts_min, tb->qp);
|
||||||
|
return level_scale[0][rem6[qp]] << div6[qp];
|
||||||
|
}
|
||||||
|
|
||||||
int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const int ry)
|
int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const int ry)
|
||||||
{
|
{
|
||||||
const VVCFrameContext *fc = lc->fc;
|
const VVCFrameContext *fc = lc->fc;
|
||||||
|
@ -45,5 +45,6 @@ int ff_vvc_intra_pred_angle_derive(int pred_mode);
|
|||||||
int ff_vvc_intra_inv_angle_derive(int pred_mode);
|
int ff_vvc_intra_inv_angle_derive(int pred_mode);
|
||||||
int ff_vvc_wide_angle_mode_mapping(const CodingUnit *cu,
|
int ff_vvc_wide_angle_mode_mapping(const CodingUnit *cu,
|
||||||
int tb_width, int tb_height, int c_idx, int pred_mode_intra);
|
int tb_width, int tb_height, int c_idx, int pred_mode_intra);
|
||||||
|
int ff_vvc_palette_derive_scale(VVCLocalContext *lc, const TransformUnit *tu, TransformBlock *tb);
|
||||||
|
|
||||||
#endif // AVCODEC_VVC_INTRA_H
|
#endif // AVCODEC_VVC_INTRA_H
|
||||||
|
Reference in New Issue
Block a user