Loading media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { Loading Loading @@ -64,8 +65,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ C2F(mSize, width).inRange(16, 1920, 4), C2F(mSize, height).inRange(16, 1088, 4), C2F(mSize, width).inRange(16, kMaxDimension, 2), C2F(mSize, height).inRange(16, kMaxDimension, 2), }) .withSetter(SizeSetter) .build()); Loading @@ -91,8 +92,8 @@ public: DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(MaxPictureSizeSetter, mSize) .build()); Loading Loading @@ -204,8 +205,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; // 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().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); 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), kMaxDimension); return C2R::Ok(); } Loading media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +8 −25 Original line number Diff line number Diff line Loading @@ -35,8 +35,10 @@ namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; #ifdef MPEG4 constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; #else constexpr size_t kMaxDimension = 352; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; #endif Loading Loading @@ -75,13 +77,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(SizeSetter) .build()); Loading Loading @@ -130,19 +127,10 @@ public: addParameter( DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) #ifdef MPEG4 .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 1920, 1088)) #else .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) #endif .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(MaxPictureSizeSetter, mSize) .build()); Loading Loading @@ -200,13 +188,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; // 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), 1920u); 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 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), kMaxDimension); return C2R::Ok(); } Loading Loading
media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { Loading Loading @@ -64,8 +65,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ C2F(mSize, width).inRange(16, 1920, 4), C2F(mSize, height).inRange(16, 1088, 4), C2F(mSize, width).inRange(16, kMaxDimension, 2), C2F(mSize, height).inRange(16, kMaxDimension, 2), }) .withSetter(SizeSetter) .build()); Loading @@ -91,8 +92,8 @@ public: DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(MaxPictureSizeSetter, mSize) .build()); Loading Loading @@ -204,8 +205,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; // 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().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); 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), kMaxDimension); return C2R::Ok(); } Loading
media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +8 −25 Original line number Diff line number Diff line Loading @@ -35,8 +35,10 @@ namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; #ifdef MPEG4 constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; #else constexpr size_t kMaxDimension = 352; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; #endif Loading Loading @@ -75,13 +77,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(SizeSetter) .build()); Loading Loading @@ -130,19 +127,10 @@ public: addParameter( DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) #ifdef MPEG4 .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 1920, 1088)) #else .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) #endif .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) .withSetter(MaxPictureSizeSetter, mSize) .build()); Loading Loading @@ -200,13 +188,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; // 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), 1920u); 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 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), kMaxDimension); return C2R::Ok(); } Loading