aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubash Lakkimsetti2013-11-04 14:01:12 -0600
committerSubash Lakkimsetti2013-11-04 14:01:12 -0600
commit693d836d994d1c255b7453f3b3a1d04006e5e94e (patch)
treee2dd4071672302ba88371d134abe968c96356b3b /test_qnx
parent9fe561ae819b96df01f0d40d0f76a3ededa6b0fb (diff)
downloadrepo-libdce-693d836d994d1c255b7453f3b3a1d04006e5e94e.tar.gz
repo-libdce-693d836d994d1c255b7453f3b3a1d04006e5e94e.tar.xz
repo-libdce-693d836d994d1c255b7453f3b3a1d04006e5e94e.zip
[FIX][DCE_ENC_TEST] Allocate buffer for Motion vector and SAD
enableAnalyticinfo is enabled by default for MPEG4/H263 encode and the required MVInfo buffer is not allocated. This leads to memory corruption in MPEG4/H263 codec for encode with certain resolutions on QNX platform. Buffer handling is added for MVInfo buffer when enableAnalyticinfo is enabled. enableAnalyticinfo is disabled by default for MPEG4/H263 encode case. For Internal reference, it fixes the DRT OMAPS00300892 - 720P video encode is not functional with MPEG4/H263 Change-Id: I13d5d61faf8352d884070c3e1f17bb7005157334 Signed-off-by: Subash Lakkimsetti <x0091084@ti.com>
Diffstat (limited to 'test_qnx')
-rw-r--r--test_qnx/dce_enc_test/dce_enc_test.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/test_qnx/dce_enc_test/dce_enc_test.c b/test_qnx/dce_enc_test/dce_enc_test.c
index 62215e2..6d337bb 100644
--- a/test_qnx/dce_enc_test/dce_enc_test.c
+++ b/test_qnx/dce_enc_test/dce_enc_test.c
@@ -426,7 +426,9 @@ int main(int argc, char * *argv)
426 Engine_Error ec; 426 Engine_Error ec;
427 XDAS_Int32 err; 427 XDAS_Int32 err;
428 char *output = NULL; 428 char *output = NULL;
429 char *output_mvbuf = NULL;
429 int output_size = 0; 430 int output_size = 0;
431 int mvbufinfo_size = 0;
430 char *in_pattern, *out_pattern; 432 char *in_pattern, *out_pattern;
431 int in_cnt = 0, out_cnt = 0; 433 int in_cnt = 0, out_cnt = 0;
432 int oned; 434 int oned;
@@ -927,7 +929,7 @@ int main(int argc, char * *argv)
927 mpeg4enc_params->enableSceneChangeAlgo = IMPEG4ENC_SCDA_DISABLE; 929 mpeg4enc_params->enableSceneChangeAlgo = IMPEG4ENC_SCDA_DISABLE;
928 mpeg4enc_params->useVOS = 0; 930 mpeg4enc_params->useVOS = 0;
929 mpeg4enc_params->enableMONA = 0; 931 mpeg4enc_params->enableMONA = 0;
930 mpeg4enc_params->enableAnalyticinfo = 0; 932 mpeg4enc_params->enableAnalyticinfo = -1;
931 mpeg4enc_params->debugTraceLevel = 0; 933 mpeg4enc_params->debugTraceLevel = 0;
932 mpeg4enc_params->lastNFramesToLog = 0; 934 mpeg4enc_params->lastNFramesToLog = 0;
933 935
@@ -1161,10 +1163,11 @@ int main(int argc, char * *argv)
1161 // XDM_GETBUFINFO 1163 // XDM_GETBUFINFO
1162 // Send Control cmd XDM_GETBUFINFO to get min output and output size 1164 // Send Control cmd XDM_GETBUFINFO to get min output and output size
1163 err = VIDENC2_control(codec, XDM_GETBUFINFO, dynParams, status); 1165 err = VIDENC2_control(codec, XDM_GETBUFINFO, dynParams, status);
1164 DEBUG("VIDENC2_control - XDM_GETBUFINFO err %d status numOutBuf %d OutBufSize %d", err, status->bufInfo.minNumOutBufs, status->bufInfo.minOutBufSize[0].bytes); 1166 DEBUG("VIDENC2_control - XDM_GETBUFINFO err %d status numOutBuf %d OutBufSize %d MVBufInfo %d", err, status->bufInfo.minNumOutBufs, status->bufInfo.minOutBufSize[0].bytes, status->bufInfo.minOutBufSize[1].bytes);
1165 1167
1166 outBufs = dce_alloc(sizeof(XDM2_BufDesc)); 1168 outBufs = dce_alloc(sizeof(XDM2_BufDesc));
1167 output_size = status->bufInfo.minOutBufSize[0].bytes; 1169 output_size = status->bufInfo.minOutBufSize[0].bytes;
1170 mvbufinfo_size = status->bufInfo.minOutBufSize[1].bytes;
1168 1171
1169 DEBUG("Output allocate through tiler 1D"); 1172 DEBUG("Output allocate through tiler 1D");
1170 if( codec_switch == DCE_ENC_TEST_H264 ) { 1173 if( codec_switch == DCE_ENC_TEST_H264 ) {
@@ -1184,6 +1187,19 @@ int main(int argc, char * *argv)
1184 1187
1185 DEBUG("outBufs->descs[0].buf %p output %p", outBufs->descs[0].buf, output); 1188 DEBUG("outBufs->descs[0].buf %p output %p", outBufs->descs[0].buf, output);
1186 1189
1190 if(mvbufinfo_size > 0){
1191#ifdef NON_TILER_OUTPUT
1192 output_mvbuf = output_allocate_nonTiler(mvbufinfo_size);
1193#endif
1194
1195 output_mvbuf = tiler_alloc(mvbufinfo_size, 0);
1196 outBufs->descs[1].buf = (XDAS_Int8 *)output_mvbuf;
1197
1198 outBufs->descs[1].memType = XDM_MEMTYPE_RAW;
1199 outBufs->descs[1].bufSize.bytes = mvbufinfo_size;
1200 DEBUG("MVBufInfo: outBufs->descs[1].buf %p output_mvbuf %p", outBufs->descs[1].buf, output_mvbuf);
1201 }
1202
1187#ifdef DUMPINPUTDATA 1203#ifdef DUMPINPUTDATA
1188 char Buff1[100]; 1204 char Buff1[100];
1189 int static GlobalCount1 = 0; 1205 int static GlobalCount1 = 0;
@@ -1519,10 +1535,18 @@ out:
1519 if( output ) { 1535 if( output ) {
1520 MemMgr_Free(output); 1536 MemMgr_Free(output);
1521 } 1537 }
1538 if(output_mvbuf){
1539 printf("\nFreeing output %p...\n", output_mvbuf);
1540 MemMgr_Free(output_mvbuf);
1541 }
1522#ifdef NON_TILER_OUTPUT 1542#ifdef NON_TILER_OUTPUT
1523 if( output ) { 1543 if( output ) {
1524 output_enc_free(output, output_size); 1544 output_enc_free(output, output_size);
1525 } 1545 }
1546 if(output_mvbuf){
1547 printf("\nFreeing mvbuf output %p...\n", output_mvbuf);
1548 output_enc_free(output_mvbuf, mvbufinfo_size);
1549 }
1526#endif 1550#endif
1527 1551
1528 printf("\nFreeing buf %p...\n", buf); 1552 printf("\nFreeing buf %p...\n", buf);