passed files: LMCS_B_Dolby_2.bit CodingToolsSets_E_Tencent_1.bit SUBPIC_A_HUAWEI_3.bit SUBPIC_B_HUAWEI_3.bit SUBPIC_C_ERICSSON_1.bit SUBPIC_D_ERICSSON_1.bit SUBPIC_E_MediaTek_1.bit passed dvb conformance files (https://dvb.org/specifications/verification-validation/vvc-test-content): VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.bit VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_PiP.bit
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -30,14 +30,34 @@ · 29 unmodified lines | ||
| 30 | 30 | #define PROF_TEMP_OFFSET (MAX_PB_SIZE + 32) |
| 31 | 31 | static const int bcw_w_lut[] = {4, 5, 3, 10, -2}; |
| 32 | 32 | |
| 33 | −static int emulated_edge(const VVCFrameContext *fc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 34 | − const int x_off, const int y_off, const int block_w, const int block_h, const int is_luma) | |
| 33 | +static void subpic_offset(int *x_off, int *y_off, | |
| 34 | + const VVCSPS *sps, const VVCPPS *pps, const int subpic_idx, const int is_luma) | |
| 35 | 35 | { |
| 36 | − const int extra_before = is_luma ? LUMA_EXTRA_BEFORE : CHROMA_EXTRA_BEFORE; | |
| 37 | − const int extra_after = is_luma ? LUMA_EXTRA_AFTER : CHROMA_EXTRA_AFTER; | |
| 38 | − const int extra = is_luma ? LUMA_EXTRA : CHROMA_EXTRA; | |
| 39 | − const int pic_width = is_luma ? fc->ps.pps->width : (fc->ps.pps->width >> fc->ps.sps->hshift[1]); | |
| 40 | − const int pic_height = is_luma ? fc->ps.pps->height : (fc->ps.pps->height >> fc->ps.sps->vshift[1]); | |
| 36 | + *x_off -= pps->subpic_x[subpic_idx] >> sps->hshift[!is_luma]; | |
| 37 | + *y_off -= pps->subpic_y[subpic_idx] >> sps->vshift[!is_luma]; | |
| 38 | +} | |
| 39 | + | |
| 40 | +static void subpic_width_height(int *pic_width, int *pic_height, | |
| 41 | + const VVCSPS *sps, const VVCPPS *pps, const int subpic_idx, const int is_luma) | |
| 42 | +{ | |
| 43 | + *pic_width = pps->subpic_width[subpic_idx] >> sps->hshift[!is_luma]; | |
| 44 | + *pic_height = pps->subpic_height[subpic_idx] >> sps->vshift[!is_luma]; | |
| 45 | +} | |
| 46 | + | |
| 47 | +static int emulated_edge(const VVCLocalContext *lc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 48 | + int x_off, int y_off, const int block_w, const int block_h, const int is_luma) | |
| 49 | +{ | |
| 50 | + const VVCFrameContext *fc = lc->fc; | |
| 51 | + const VVCSPS *sps = fc->ps.sps; | |
| 52 | + const VVCPPS *pps = fc->ps.pps; | |
| 53 | + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; | |
| 54 | + const int extra_before = is_luma ? LUMA_EXTRA_BEFORE : CHROMA_EXTRA_BEFORE; | |
| 55 | + const int extra_after = is_luma ? LUMA_EXTRA_AFTER : CHROMA_EXTRA_AFTER; | |
| 56 | + const int extra = is_luma ? LUMA_EXTRA : CHROMA_EXTRA; | |
| 57 | + int pic_width, pic_height; | |
| 58 | + | |
| 59 | + subpic_offset(&x_off, &y_off, sps, pps, subpic_idx, is_luma); | |
| 60 | + subpic_width_height(&pic_width, &pic_height, sps, pps, subpic_idx, is_luma); | |
| 41 | 61 | |
| 42 | 62 | if (x_off < extra_before || y_off < extra_before || |
| 43 | 63 | x_off >= pic_width - block_w - extra_after || |
| @@ -57,14 +77,21 @@ static int emulated_edge(const VVCFrameContext *fc, uint8_t *dst, const uint8_t · 13 unmodified lines | ||
| 57 | 77 | return 0; |
| 58 | 78 | } |
| 59 | 79 | |
| 60 | −static void emulated_edge_dmvr(const VVCFrameContext *fc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 61 | − const int x_sb, const int y_sb, const int x_off, const int y_off, const int block_w, const int block_h, const int is_luma) | |
| 80 | +static void emulated_edge_dmvr(const VVCLocalContext *lc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 81 | + int x_sb, int y_sb, int x_off, int y_off, const int block_w, const int block_h, const int is_luma) | |
| 62 | 82 | { |
| 63 | − const int extra_before = is_luma ? LUMA_EXTRA_BEFORE : CHROMA_EXTRA_BEFORE; | |
| 64 | − const int extra_after = is_luma ? LUMA_EXTRA_AFTER : CHROMA_EXTRA_AFTER; | |
| 65 | − const int extra = is_luma ? LUMA_EXTRA : CHROMA_EXTRA; | |
| 66 | − const int pic_width = is_luma ? fc->ps.pps->width : (fc->ps.pps->width >> fc->ps.sps->hshift[1]); | |
| 67 | − const int pic_height = is_luma ? fc->ps.pps->height : (fc->ps.pps->height >> fc->ps.sps->vshift[1]); | |
| 83 | + const VVCFrameContext *fc = lc->fc; | |
| 84 | + const VVCSPS *sps = fc->ps.sps; | |
| 85 | + const VVCPPS *pps = fc->ps.pps; | |
| 86 | + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; | |
| 87 | + const int extra_before = is_luma ? LUMA_EXTRA_BEFORE : CHROMA_EXTRA_BEFORE; | |
| 88 | + const int extra_after = is_luma ? LUMA_EXTRA_AFTER : CHROMA_EXTRA_AFTER; | |
| 89 | + const int extra = is_luma ? LUMA_EXTRA : CHROMA_EXTRA; | |
| 90 | + int pic_width, pic_height; | |
| 91 | + | |
| 92 | + subpic_offset(&x_off, &y_off, sps, pps, subpic_idx, is_luma); | |
| 93 | + subpic_offset(&x_sb, &y_sb, sps, pps, subpic_idx, is_luma); | |
| 94 | + subpic_width_height(&pic_width, &pic_height, sps, pps, subpic_idx, is_luma); | |
| 68 | 95 | |
| 69 | 96 | if (x_off < extra_before || y_off < extra_before || |
| 70 | 97 | x_off >= pic_width - block_w - extra_after || |
| @@ -88,11 +115,17 @@ static void emulated_edge_dmvr(const VVCFrameContext *fc, uint8_t *dst, const ui · 17 unmodified lines | ||
| 88 | 115 | } |
| 89 | 116 | } |
| 90 | 117 | |
| 91 | −static void emulated_edge_bilinear(const VVCFrameContext *fc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 92 | − const int x_off, const int y_off, const int block_w, const int block_h) | |
| 118 | +static void emulated_edge_bilinear(const VVCLocalContext *lc, uint8_t *dst, const uint8_t **src, ptrdiff_t *src_stride, | |
| 119 | + int x_off, int y_off, const int block_w, const int block_h) | |
| 93 | 120 | { |
| 94 | − int pic_width = fc->ps.pps->width; | |
| 95 | − int pic_height = fc->ps.pps->height; | |
| 121 | + const VVCFrameContext *fc = lc->fc; | |
| 122 | + const VVCSPS *sps = fc->ps.sps; | |
| 123 | + const VVCPPS *pps = fc->ps.pps; | |
| 124 | + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; | |
| 125 | + int pic_width, pic_height; | |
| 126 | + | |
| 127 | + subpic_offset(&x_off, &y_off, sps, pps, subpic_idx, 1); | |
| 128 | + subpic_width_height(&pic_width, &pic_height, sps, pps, subpic_idx, 1); | |
| 96 | 129 | |
| 97 | 130 | if (x_off < BILINEAR_EXTRA_BEFORE || y_off < BILINEAR_EXTRA_BEFORE || |
| 98 | 131 | x_off >= pic_width - block_w - BILINEAR_EXTRA_AFTER || |
| @@ -111,19 +144,19 @@ static void emulated_edge_bilinear(const VVCFrameContext *fc, uint8_t *dst, cons · 12 unmodified lines | ||
| 111 | 144 | |
| 112 | 145 | |
| 113 | 146 | #define EMULATED_EDGE_LUMA(dst, src, src_stride, x_off, y_off) \ |
| 114 | − emulated_edge(fc, dst, src, src_stride, x_off, y_off, block_w, block_h, 1) | |
| 147 | + emulated_edge(lc, dst, src, src_stride, x_off, y_off, block_w, block_h, 1) | |
| 115 | 148 | |
| 116 | 149 | #define EMULATED_EDGE_CHROMA(dst, src, src_stride, x_off, y_off) \ |
| 117 | − emulated_edge(fc, dst, src, src_stride, x_off, y_off, block_w, block_h, 0) | |
| 150 | + emulated_edge(lc, dst, src, src_stride, x_off, y_off, block_w, block_h, 0) | |
| 118 | 151 | |
| 119 | 152 | #define EMULATED_EDGE_DMVR_LUMA(dst, src, src_stride, x_sb, y_sb, x_off, y_off) \ |
| 120 | − emulated_edge_dmvr(fc, dst, src, src_stride, x_sb, y_sb, x_off, y_off, block_w, block_h, 1) | |
| 153 | + emulated_edge_dmvr(lc, dst, src, src_stride, x_sb, y_sb, x_off, y_off, block_w, block_h, 1) | |
| 121 | 154 | |
| 122 | 155 | #define EMULATED_EDGE_DMVR_CHROMA(dst, src, src_stride, x_sb, y_sb, x_off, y_off) \ |
| 123 | − emulated_edge_dmvr(fc, dst, src, src_stride, x_sb, y_sb, x_off, y_off, block_w, block_h, 0) | |
| 156 | + emulated_edge_dmvr(lc, dst, src, src_stride, x_sb, y_sb, x_off, y_off, block_w, block_h, 0) | |
| 124 | 157 | |
| 125 | 158 | #define EMULATED_EDGE_BILINEAR(dst, src, src_stride, x_off, y_off) \ |
| 126 | − emulated_edge_bilinear(fc, dst, src, src_stride, x_off, y_off, pred_w, pred_h) | |
| 159 | + emulated_edge_bilinear(lc, dst, src, src_stride, x_off, y_off, pred_w, pred_h) | |
| 127 | 160 | |
| 128 | 161 | // part of 8.5.6.6 Weighted sample prediction process |
| 129 | 162 | static int derive_weight_uni(int *denom, int *wx, int *ox, |