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

Commit 3f714d73 authored by Vignesh Venkatasubramanian's avatar Vignesh Venkatasubramanian
Browse files

vpx: Allow odd width/height decoding

Allow the vpx (vp8 and vp9) decoder components to decode videos
with odd dimensions. This supported by the underlying software
decoders.

We create a graphic buffer that is width aligned to 16 and
height aligned to 2 and then set the "crop" value to the
appropriate video dimensions.

This CL contains changes to files in mainline.

Bug: 224983103
Test: CtsMediaTestCases still passes.
Change-Id: I66fed7df93bc1f5be001209d51a32f9878f78ce7
parent 3228b2d2
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -69,8 +69,8 @@ public:
                DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
                .withFields({
                    C2F(mSize, width).inRange(2, 2048, 2),
                    C2F(mSize, height).inRange(2, 2048, 2),
                    C2F(mSize, width).inRange(2, 2048),
                    C2F(mSize, height).inRange(2, 2048),
                })
                .withSetter(SizeSetter)
                .build());
@@ -691,7 +691,12 @@ status_t C2SoftVpxDec::outputBuffer(
        format = getHalPixelFormatForBitDepth10(allowRGBA1010102);
    }
    C2MemoryUsage usage = { C2MemoryUsage::CPU_READ, C2MemoryUsage::CPU_WRITE };
    c2_status_t err = pool->fetchGraphicBlock(align(mWidth, 16), mHeight, format, usage, &block);
    // We always create a graphic block that is width aligned to 16 and height
    // aligned to 2. We set the correct "crop" value of the image in the call to
    // createGraphicBuffer() by setting the correct image dimensions.
    c2_status_t err = pool->fetchGraphicBlock(align(mWidth, 16),
                                              align(mHeight, 2), format, usage,
                                              &block);
    if (err != C2_OK) {
        ALOGE("fetchGraphicBlock for Output failed with status %d", err);
        work->result = err;