aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2013-09-18 13:46:41 -0500
committerSunita Nadampalli2013-09-18 13:46:41 -0500
commit50fb84c011c169b79079afe27738c07dc4e1d6e5 (patch)
treedc7485344fb3bc220d40cd72588fc5120376dea8 /libdce.c
parentaf40f90fce27e0f3de872f78f70c1715d14a7473 (diff)
downloadrepo-libdce-50fb84c011c169b79079afe27738c07dc4e1d6e5.tar.gz
repo-libdce-50fb84c011c169b79079afe27738c07dc4e1d6e5.tar.xz
repo-libdce-50fb84c011c169b79079afe27738c07dc4e1d6e5.zip
[LIBDCE] Add single planar output buffer support for Android
Android Thumbnail scenario allocates both input and out buffers from ION carveout. A single buffer is allocated for both Y and UV, with an offset for UV. This patch adds support for single planar buffers with memheaders required for the Android thumbnail scenario. Change-Id: I18306d2b07fe89f667d3f04bf5769ef1f2585c9d Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'libdce.c')
-rw-r--r--libdce.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/libdce.c b/libdce.c
index 85df03f..63b548a 100644
--- a/libdce.c
+++ b/libdce.c
@@ -501,6 +501,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
501 501
502#ifdef BUILDOS_ANDROID 502#ifdef BUILDOS_ANDROID
503 int32_t inbuf_offset[MAX_INPUT_BUF]; 503 int32_t inbuf_offset[MAX_INPUT_BUF];
504 int32_t outbuf_offset[MAX_OUTPUT_BUF];
504#endif 505#endif
505 506
506 _ASSERT(codec != NULL, DCE_EINVALID_INPUT); 507 _ASSERT(codec != NULL, DCE_EINVALID_INPUT);
@@ -545,7 +546,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
545 inbuf_offset[count] = P2H(*data_buf)->offset; 546 inbuf_offset[count] = P2H(*data_buf)->offset;
546 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), INBUFS_INDEX, MmRpc_OFFSET((int32_t)inBufs, (int32_t)data_buf), 547 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), INBUFS_INDEX, MmRpc_OFFSET((int32_t)inBufs, (int32_t)data_buf),
547 (size_t)P2H(*data_buf), (size_t)memplugin_share((void *)*data_buf)); 548 (size_t)P2H(*data_buf), (size_t)memplugin_share((void *)*data_buf));
548 *(uint8_t *)data_buf += inbuf_offset[count]; 549 *data_buf += inbuf_offset[count];
549#else 550#else
550 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), INBUFS_INDEX, MmRpc_OFFSET((int32_t)inBufs, (int32_t)data_buf), 551 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), INBUFS_INDEX, MmRpc_OFFSET((int32_t)inBufs, (int32_t)data_buf),
551 (size_t)*data_buf, (size_t)*data_buf); 552 (size_t)*data_buf, (size_t)*data_buf);
@@ -581,6 +582,19 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
581 } 582 }
582 } 583 }
583 } 584 }
585#elif defined(BUILDOS_ANDROID)
586 else {
587 /* SinglePlanar Buffers for Decode usecase*/
588 /* the decoder out buffers allocated from non2D region have an offset */
589 /* for the UV data. the offset within the input buffer is provided */
590 /* via memheader offset field. Hence the buf ptr needs to be advanced with the offset */
591 data_buf = (void * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf));
592 outbuf_offset[count] = P2H(*data_buf)->offset;
593 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX, MmRpc_OFFSET((int32_t)outBufs, (int32_t)data_buf), (size_t)P2H(*data_buf), (size_t)memplugin_share((void*)*data_buf));
594 if(count == CHROMA_BUF) {
595 *data_buf += outbuf_offset[count];
596 }
597 }
584#endif 598#endif
585 } 599 }
586 600
@@ -595,7 +609,16 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
595 if( codec_id == OMAP_DCE_VIDDEC3 ) { 609 if( codec_id == OMAP_DCE_VIDDEC3 ) {
596 /* restore the actual buf ptr before returing to the mmf */ 610 /* restore the actual buf ptr before returing to the mmf */
597 data_buf = (void * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf)); 611 data_buf = (void * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf));
598 *(uint8_t *)data_buf -= inbuf_offset[count]; 612 *data_buf -= inbuf_offset[count];
613 }
614 }
615 /* Output Buffers */
616 for( count = 0; count < numOutBufs; count++ ) {
617 /* restore the actual ptr for UV buffer allocated from */
618 /* non2D region */
619 if(count == CHROMA_BUF && outbuf_offset[count]) {
620 data_buf = (void * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf));
621 *data_buf -= outbuf_offset[count];
599 } 622 }
600 } 623 }
601 624