Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66e98bd1 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by Lajos Molnar
Browse files

C2SoftVpxEnc: Add support for encoding from a larger graphic block

Currently buffer dimensions are expected to be same as encode dimension.
Updated the checks to allow for encoding from larger graphic block

Bug: 158120386
Test: Encode 340x280 from a decoder surface with dimensions 384x288

Change-Id: I9eed491d3211b42cc4b9f7e42fb386240c745b15
parent 3244d0db
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -460,8 +460,8 @@ void C2SoftVpxEnc::process(

    const C2ConstGraphicBlock inBuffer =
        inputBuffer->data().graphicBlocks().front();
    if (inBuffer.width() != mSize->width ||
        inBuffer.height() != mSize->height) {
    if (inBuffer.width() < mSize->width ||
        inBuffer.height() < mSize->height) {
        ALOGE("unexpected Input buffer attributes %d(%d) x %d(%d)",
              inBuffer.width(), mSize->width, inBuffer.height(),
              mSize->height);
@@ -472,8 +472,8 @@ void C2SoftVpxEnc::process(
    bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
    vpx_image_t raw_frame;
    const C2PlanarLayout &layout = rView->layout();
    uint32_t width = rView->width();
    uint32_t height = rView->height();
    uint32_t width = mSize->width;
    uint32_t height = mSize->height;
    if (width > 0x8000 || height > 0x8000) {
        ALOGE("Image too big: %u x %u", width, height);
        work->result = C2_BAD_VALUE;