Round width and height to next 8 pixels instead of 4

* New macro CONF_WINDOW_PAD_IN_PIXELS
This commit is contained in:
Marko Viitanen 2022-06-14 14:31:57 +03:00
parent c2d82c0238
commit 429e945496
3 changed files with 11 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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