mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/vvcdec: fix dual tree for skipped transform tree/unit
fix IBC_E_Tencent_1.bit
This commit is contained in:
parent
c503c0b33e
commit
1ffeeb8a26
@ -481,8 +481,9 @@ static int hls_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_width,
|
|||||||
|
|
||||||
static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_width, int tu_height)
|
static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_width, int tu_height)
|
||||||
{
|
{
|
||||||
VVCFrameContext *fc = lc->fc;
|
VVCFrameContext *fc = lc->fc;
|
||||||
const VVCSPS *sps = fc->ps.sps;
|
const CodingUnit *cu = lc->cu;
|
||||||
|
const VVCSPS *sps = fc->ps.sps;
|
||||||
|
|
||||||
if (tu_width > sps->max_tb_size_y || tu_height > sps->max_tb_size_y) {
|
if (tu_width > sps->max_tb_size_y || tu_height > sps->max_tb_size_y) {
|
||||||
const int ver_split_first = tu_width > sps->max_tb_size_y && tu_width > tu_height;
|
const int ver_split_first = tu_width > sps->max_tb_size_y && tu_width > tu_height;
|
||||||
@ -501,11 +502,14 @@ static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_wid
|
|||||||
else
|
else
|
||||||
SKIPPED_TRANSFORM_TREE(x0, y0 + trafo_height);
|
SKIPPED_TRANSFORM_TREE(x0, y0 + trafo_height);
|
||||||
} else {
|
} else {
|
||||||
TransformUnit *tu = add_tu(fc, lc->cu, x0, y0, tu_width, tu_height);
|
TransformUnit *tu = add_tu(fc, lc->cu, x0, y0, tu_width, tu_height);
|
||||||
const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : (LUMA + 1);
|
const int has_chroma = sps->r->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA;
|
||||||
|
const int c_start = cu->tree_type == DUAL_TREE_CHROMA ? CB : LUMA;
|
||||||
|
const int c_end = has_chroma ? VVC_MAX_SAMPLE_ARRAYS : CB;
|
||||||
|
|
||||||
if (!tu)
|
if (!tu)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
for (int i = LUMA; i < c_end; i++) {
|
for (int i = c_start; i < c_end; i++) {
|
||||||
TransformBlock *tb = add_tb(tu, lc, x0, y0, tu_width >> sps->hshift[i], tu_height >> sps->vshift[i], i);
|
TransformBlock *tb = add_tb(tu, lc, x0, y0, tu_width >> sps->hshift[i], tu_height >> sps->vshift[i], i);
|
||||||
if (i != CR)
|
if (i != CR)
|
||||||
set_tb_pos(fc, tb);
|
set_tb_pos(fc, tb);
|
||||||
@ -1125,11 +1129,14 @@ static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps)
|
|||||||
|
|
||||||
static int skipped_transform_tree_unit(VVCLocalContext *lc)
|
static int skipped_transform_tree_unit(VVCLocalContext *lc)
|
||||||
{
|
{
|
||||||
const CodingUnit *cu = lc->cu;
|
const H266RawSPS *rsps = lc->fc->ps.sps->r;
|
||||||
|
const CodingUnit *cu = lc->cu;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
set_qp_y(lc, cu->x0, cu->y0, 0);
|
if (cu->tree_type != DUAL_TREE_CHROMA)
|
||||||
set_qp_c(lc);
|
set_qp_y(lc, cu->x0, cu->y0, 0);
|
||||||
|
if (rsps->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA)
|
||||||
|
set_qp_c(lc);
|
||||||
ret = skipped_transform_tree(lc, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
ret = skipped_transform_tree(lc, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@ -1815,7 +1822,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
av_assert0(tree_type == SINGLE_TREE);
|
|
||||||
ret = skipped_transform_tree_unit(lc);
|
ret = skipped_transform_tree_unit(lc);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -602,8 +602,10 @@ int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const in
|
|||||||
if (cu->coded_flag) {
|
if (cu->coded_flag) {
|
||||||
ret = reconstruct(lc);
|
ret = reconstruct(lc);
|
||||||
} else {
|
} else {
|
||||||
add_reconstructed_area(lc, LUMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
if (cu->tree_type != DUAL_TREE_CHROMA)
|
||||||
add_reconstructed_area(lc, CHROMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
add_reconstructed_area(lc, LUMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
||||||
|
if (sps->r->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA)
|
||||||
|
add_reconstructed_area(lc, CHROMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height);
|
||||||
}
|
}
|
||||||
cu = cu->next;
|
cu = cu->next;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user