Commit dac5e391 authored by Luc Trudeau's avatar Luc Trudeau

[CFL] Get subsampling from AV1 common

This change does not impact the bitstream
  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
0.0000 |  0.0000 |  0.0000 |   0.0000 | 0.0000 |  0.0000 |     0.0000

Change-Id: I6e131e91bad5efa345ed2542ae970eb6122eff51
parent e2ac9855
......@@ -15,16 +15,15 @@
#include "aom/internal/aom_codec_internal.h"
void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm, int subsampling_x,
int subsampling_y) {
if (!((subsampling_x == 0 && subsampling_y == 0) ||
(subsampling_x == 1 && subsampling_y == 1))) {
void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm) {
if (!((cm->subsampling_x == 0 && cm->subsampling_y == 0) ||
(cm->subsampling_x == 1 && cm->subsampling_y == 1))) {
aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM,
"Only 4:4:4 and 4:2:0 are currently supported by CfL");
}
memset(&cfl->y_pix, 0, sizeof(uint8_t) * MAX_SB_SQUARE);
cfl->subsampling_x = subsampling_x;
cfl->subsampling_y = subsampling_y;
cfl->subsampling_x = cm->subsampling_x;
cfl->subsampling_y = cm->subsampling_y;
}
// CfL computes its own block-level DC_PRED. This is required to compute both
......
......@@ -57,8 +57,7 @@ static const int cfl_alpha_codes[CFL_ALPHABET_SIZE][CFL_PRED_PLANES] = {
{ 0, 3 }, { 5, 1 }, { 1, 5 }, { 0, 5 }
};
void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm, int subsampling_x,
int subsampling_y);
void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm);
void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
......
......@@ -532,8 +532,7 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
#endif
#if CONFIG_CFL
xd->cfl = cfl;
cfl_init(cfl, cm, xd->plane[AOM_PLANE_U].subsampling_x,
xd->plane[AOM_PLANE_U].subsampling_y);
cfl_init(cfl, cm);
#endif
xd->above_context[i] = cm->above_context[i];
if (xd->plane[i].plane_type == PLANE_TYPE_Y) {
......
......@@ -4512,8 +4512,7 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row,
#if CONFIG_CFL
MACROBLOCKD *const xd = &td->mb.e_mbd;
xd->cfl = &this_tile->cfl;
cfl_init(xd->cfl, cm, xd->plane[AOM_PLANE_U].subsampling_x,
xd->plane[AOM_PLANE_U].subsampling_y);
cfl_init(xd->cfl, cm);
#endif
#if CONFIG_PVQ
......
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