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

Commit b73b17cd authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "C2Soft decoders: Increase max height to support portrait videos" am:...

Merge "C2Soft decoders: Increase max height to support portrait videos" am: 01e1e023 am: df6e1b24

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1559683

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2d5ee21cabe93cb6866091e315ab24d5afbb03fe
parents ea927008 df6e1b24
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@


namespace android {
namespace android {
constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024;
constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024;
constexpr size_t kMaxDimension = 1920;
constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder";
constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder";


class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams {
class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams {
@@ -64,8 +65,8 @@ public:
                DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
                .withFields({
                .withFields({
                    C2F(mSize, width).inRange(16, 1920, 4),
                    C2F(mSize, width).inRange(16, kMaxDimension, 2),
                    C2F(mSize, height).inRange(16, 1088, 4),
                    C2F(mSize, height).inRange(16, kMaxDimension, 2),
                })
                })
                .withSetter(SizeSetter)
                .withSetter(SizeSetter)
                .build());
                .build());
@@ -91,8 +92,8 @@ public:
                DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
                DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
                .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240))
                .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240))
                .withFields({
                .withFields({
                    C2F(mSize, width).inRange(2, 1920, 2),
                    C2F(mSize, width).inRange(2, kMaxDimension, 2),
                    C2F(mSize, height).inRange(2, 1088, 2),
                    C2F(mSize, height).inRange(2, kMaxDimension, 2),
                })
                })
                .withSetter(MaxPictureSizeSetter, mSize)
                .withSetter(MaxPictureSizeSetter, mSize)
                .build());
                .build());
@@ -204,8 +205,8 @@ public:
                                    const C2P<C2StreamPictureSizeInfo::output> &size) {
                                    const C2P<C2StreamPictureSizeInfo::output> &size) {
        (void)mayBlock;
        (void)mayBlock;
        // TODO: get max width/height from the size's field helpers vs. hardcoding
        // TODO: get max width/height from the size's field helpers vs. hardcoding
        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u);
        me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension);
        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u);
        me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension);
        return C2R::Ok();
        return C2R::Ok();
    }
    }


+8 −25
Original line number Original line Diff line number Diff line
@@ -35,8 +35,10 @@
namespace android {
namespace android {
constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024;
constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024;
#ifdef MPEG4
#ifdef MPEG4
constexpr size_t kMaxDimension = 1920;
constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder";
constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder";
#else
#else
constexpr size_t kMaxDimension = 352;
constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder";
constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder";
#endif
#endif


@@ -75,13 +77,8 @@ public:
                DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144))
                .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144))
                .withFields({
                .withFields({
#ifdef MPEG4
                    C2F(mSize, width).inRange(2, kMaxDimension, 2),
                    C2F(mSize, width).inRange(2, 1920, 2),
                    C2F(mSize, height).inRange(2, kMaxDimension, 2),
                    C2F(mSize, height).inRange(2, 1088, 2),
#else
                    C2F(mSize, width).inRange(2, 352, 2),
                    C2F(mSize, height).inRange(2, 288, 2),
#endif
                })
                })
                .withSetter(SizeSetter)
                .withSetter(SizeSetter)
                .build());
                .build());
@@ -130,19 +127,10 @@ public:


        addParameter(
        addParameter(
                DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
                DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
#ifdef MPEG4
                .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 1920, 1088))
#else
                .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288))
                .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288))
#endif
                .withFields({
                .withFields({
#ifdef MPEG4
                    C2F(mSize, width).inRange(2, kMaxDimension, 2),
                    C2F(mSize, width).inRange(2, 1920, 2),
                    C2F(mSize, height).inRange(2, kMaxDimension, 2),
                    C2F(mSize, height).inRange(2, 1088, 2),
#else
                    C2F(mSize, width).inRange(2, 352, 2),
                    C2F(mSize, height).inRange(2, 288, 2),
#endif
                })
                })
                .withSetter(MaxPictureSizeSetter, mSize)
                .withSetter(MaxPictureSizeSetter, mSize)
                .build());
                .build());
@@ -200,13 +188,8 @@ public:
                                    const C2P<C2StreamPictureSizeInfo::output> &size) {
                                    const C2P<C2StreamPictureSizeInfo::output> &size) {
        (void)mayBlock;
        (void)mayBlock;
        // TODO: get max width/height from the size's field helpers vs. hardcoding
        // TODO: get max width/height from the size's field helpers vs. hardcoding
#ifdef MPEG4
        me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension);
        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u);
        me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension);
        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u);
#else
        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 352u);
        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 288u);
#endif
        return C2R::Ok();
        return C2R::Ok();
    }
    }