diff --git a/src/encmain.c b/src/encmain.c index 4678a1e5..2dde1d27 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -91,8 +91,8 @@ static FILE* open_output_file(const char* filename) } static unsigned get_padding(unsigned width_or_height){ - if (width_or_height % CU_MIN_SIZE_PIXELS){ - return CU_MIN_SIZE_PIXELS - (width_or_height % CU_MIN_SIZE_PIXELS); + if (width_or_height % CONF_WINDOW_PAD_IN_PIXELS) { + return CONF_WINDOW_PAD_IN_PIXELS - (width_or_height % CONF_WINDOW_PAD_IN_PIXELS); }else{ return 0; } diff --git a/src/encoder.c b/src/encoder.c index 86259ad9..529b7ce9 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -709,12 +709,13 @@ void uvg_encoder_control_input_init(encoder_control_t * const encoder, // pixels to the dimensions, so that they are. These extra pixels will be // compressed along with the real ones but they will be cropped out before // rendering. - if (encoder->in.width % CU_MIN_SIZE_PIXELS) { - encoder->in.width += CU_MIN_SIZE_PIXELS - (width % CU_MIN_SIZE_PIXELS); + // Changed to 8 pixel interval for VVC + if (encoder->in.width % CONF_WINDOW_PAD_IN_PIXELS) { + encoder->in.width += CONF_WINDOW_PAD_IN_PIXELS - (width % CONF_WINDOW_PAD_IN_PIXELS); } - if (encoder->in.height % CU_MIN_SIZE_PIXELS) { - encoder->in.height += CU_MIN_SIZE_PIXELS - (height % CU_MIN_SIZE_PIXELS); + if (encoder->in.height % CONF_WINDOW_PAD_IN_PIXELS) { + encoder->in.height += CONF_WINDOW_PAD_IN_PIXELS - (height % CONF_WINDOW_PAD_IN_PIXELS); } encoder->in.height_in_lcu = encoder->in.height / LCU_WIDTH; diff --git a/src/global.h b/src/global.h index 444cdfac..1f90997d 100644 --- a/src/global.h +++ b/src/global.h @@ -175,6 +175,10 @@ typedef int16_t mv_t; //! pow(2, MIN_SIZE) #define CU_MIN_SIZE_PIXELS (1 << MIN_SIZE) + +//! Round frame size up to this interval (8 pixels) +#define CONF_WINDOW_PAD_IN_PIXELS ((1 << MIN_SIZE)<<1) + //! spec: CtbSizeY #define LCU_WIDTH (1 << (MIN_SIZE + MAX_DEPTH)) //! spec: CtbWidthC and CtbHeightC