Skip to content

Commit

Permalink
do not pad image size to 16x16 pixels minimum for AOM encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed May 12, 2021
1 parent 31d44ed commit ec1dc46
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions libheif/heif_encoder_aom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ void aom_query_input_colorspace2(void* encoder_raw, heif_colorspace* colorspace,
void aom_query_encoded_size(void* encoder, uint32_t input_width, uint32_t input_height,
uint32_t* encoded_width, uint32_t* encoded_height)
{
*encoded_width = std::max(input_width, 16U);
*encoded_height = std::max(input_height, 16U);
*encoded_width = input_width;
*encoded_height = input_height;
}


Expand Down Expand Up @@ -563,16 +563,8 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i

struct heif_error err;

// --- round image size to minimum size

uint32_t rounded_width, rounded_height;
aom_query_encoded_size(encoder,
image->image->get_width(),
image->image->get_height(),
&rounded_width,
&rounded_height);

bool success = image->image->extend_padding_to_size(rounded_width, rounded_height);
bool success = image->image->extend_padding_to_size(image->image->get_width(),
image->image->get_height());
if (!success) {
err = {heif_error_Memory_allocation_error,
heif_suberror_Unspecified,
Expand Down

0 comments on commit ec1dc46

Please sign in to comment.