Fix android.media.cts.ImageReaderDecoderTest fail on MT6580 project

Root Cause:
Google C2 H264/H265 decoder request 64-aligned stride from graphic block; but ARM GPU would return
with 128-aligned stride when input height ONLY satisfies 2-aligned (e.g. 130).

Solution:
Revise stride alignment from 64 to 128 of C2 H264/H265 decoder

Bug: 142924202
Test: Build C2 Codec
Test:
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH264Image
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH264ImageReader
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH265Image
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH265ImageReader

Change-Id: I6eaff1b858e031b64744bc67d8aee5cc51cfd92d
gugelfrei
Marcus Huang 5 years ago committed by JeiFeng Lee
parent 81bfa6303d
commit 28af1154b5

@ -755,8 +755,8 @@ c2_status_t C2SoftAvcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool>
ALOGE("not supposed to be here, invalid decoder context");
return C2_CORRUPTED;
}
if (mStride != ALIGN64(mWidth)) {
mStride = ALIGN64(mWidth);
if (mStride != ALIGN128(mWidth)) {
mStride = ALIGN128(mWidth);
if (OK != setParams(mStride, IVD_DECODE_FRAME)) return C2_CORRUPTED;
}
if (mOutBlock &&

@ -40,6 +40,7 @@ namespace android {
#define ivdext_ctl_get_vui_params_ip_t ih264d_ctl_get_vui_params_ip_t
#define ivdext_ctl_get_vui_params_op_t ih264d_ctl_get_vui_params_op_t
#define ALIGN64(x) ((((x) + 63) >> 6) << 6)
#define ALIGN128(x) ((((x) + 127) >> 7) << 7)
#define MAX_NUM_CORES 4
#define IVDEXT_CMD_CTL_SET_NUM_CORES \
(IVD_CONTROL_API_COMMAND_TYPE_T)IH264D_CMD_CTL_SET_NUM_CORES

@ -752,8 +752,8 @@ c2_status_t C2SoftHevcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool>
ALOGE("not supposed to be here, invalid decoder context");
return C2_CORRUPTED;
}
if (mStride != ALIGN64(mWidth)) {
mStride = ALIGN64(mWidth);
if (mStride != ALIGN128(mWidth)) {
mStride = ALIGN128(mWidth);
if (OK != setParams(mStride, IVD_DECODE_FRAME)) return C2_CORRUPTED;
}
if (mOutBlock &&

@ -38,6 +38,7 @@ namespace android {
#define ivdext_ctl_get_vui_params_ip_t ihevcd_cxa_ctl_get_vui_params_ip_t
#define ivdext_ctl_get_vui_params_op_t ihevcd_cxa_ctl_get_vui_params_op_t
#define ALIGN64(x) ((((x) + 63) >> 6) << 6)
#define ALIGN128(x) ((((x) + 127) >> 7) << 7)
#define MAX_NUM_CORES 4
#define IVDEXT_CMD_CTL_SET_NUM_CORES \
(IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_NUM_CORES

Loading…
Cancel
Save