aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2015-10-01 12:43:00 -0500
committerBuddy Liong2015-10-01 14:00:34 -0500
commit5c45f781d307f799af9dceb5ff636d5477694e16 (patch)
treed11662e8717d483946e20d82180f3e5e8a18831e /test_qnx/dce_test/dce_test.c
parent3040e7e3f7d1ed42a1273ccc6b912328b90b16db (diff)
downloadrepo-libdce-5c45f781d307f799af9dceb5ff636d5477694e16.tar.gz
repo-libdce-5c45f781d307f799af9dceb5ff636d5477694e16.tar.xz
repo-libdce-5c45f781d307f799af9dceb5ff636d5477694e16.zip
[DCE_TEST] Fixing the decoded output resolution3.00.09.01
Previously, when decoding for example H.264 1080p (1920x1080), the output yuv comes out to be 1920x1088 because codec requires the maxWidth and maxHeight on the VIDDEC3_Params to be aligned by 16 bytes. Problem is in dce_test.c, the aligned is done early to the global variable width and height which altered the value to be aligned by 16 bytes. On the example above the height becomes 1088 (aligned by 16 bytes). When the output buffer is allocated for TILER, the outBufs->descs[0].tileMem.width = width that is aligned to 16 bytes. outBufs->descs[0].tileMem.height = height that is aligned to 16 bytes. or when the output buffer is allocated for Non-TILER, the outBufs->descs[0].bytes = width * height that is aligned to 16 bytes. With this fix, the output is now corrected to have the same resolution as the input. Eg. H.264 1080p (1920x1080) will be decoded to YUV NV12 of 1920x1080. No longer YUV NV12 of 1920x1088. Change-Id: Icdce8dfb99ffd2568ad318ff30305f83901a8243 Signed-off-by: Buddy Liong <a0270631@ti.com>
Diffstat (limited to 'test_qnx/dce_test/dce_test.c')
-rw-r--r--test_qnx/dce_test/dce_test.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/test_qnx/dce_test/dce_test.c b/test_qnx/dce_test/dce_test.c
index 7e60dd0..17fbd44 100644
--- a/test_qnx/dce_test/dce_test.c
+++ b/test_qnx/dce_test/dce_test.c
@@ -725,10 +725,6 @@ int main(int argc, char * *argv)
725 725
726 DEBUG("Num Frames is %d width=%d, height=%d", frameCount, width, height); 726 DEBUG("Num Frames is %d width=%d, height=%d", frameCount, width, height);
727 727
728 /* calculate output buffer parameters: */
729 width = ALIGN2(width, 4); /* round up to MB */
730 height = ALIGN2(height, 4); /* round up to MB */
731
732 switch( codec_switch ) { 728 switch( codec_switch ) {
733 case DCE_TEST_H264 : 729 case DCE_TEST_H264 :
734 padded_width = ALIGN2(width + (2 * PADX_H264), 7); 730 padded_width = ALIGN2(width + (2 * PADX_H264), 7);
@@ -792,7 +788,7 @@ int main(int argc, char * *argv)
792 params->maxBitRate = 10000000; 788 params->maxBitRate = 10000000;
793 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_AUTO; 789 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_AUTO;
794 params->numOutputDataUnits = 0; 790 params->numOutputDataUnits = 0;
795 params->maxWidth = width; 791 params->maxWidth = ALIGN2(width, 4);
796 break; 792 break;
797 case DCE_TEST_MPEG4 : 793 case DCE_TEST_MPEG4 :
798 params = dce_alloc(sizeof(IMPEG4VDEC_Params)); 794 params = dce_alloc(sizeof(IMPEG4VDEC_Params));
@@ -804,7 +800,7 @@ int main(int argc, char * *argv)
804 params->maxBitRate = 10000000; 800 params->maxBitRate = 10000000;
805 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1; 801 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1;
806 params->numOutputDataUnits = 0; 802 params->numOutputDataUnits = 0;
807 params->maxWidth = width; 803 params->maxWidth = ALIGN2(width, 4);
808 break; 804 break;
809 case DCE_TEST_VC1SMP : 805 case DCE_TEST_VC1SMP :
810 case DCE_TEST_VC1AP : 806 case DCE_TEST_VC1AP :
@@ -817,7 +813,7 @@ int main(int argc, char * *argv)
817 params->maxBitRate = 45000000; 813 params->maxBitRate = 45000000;
818 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1; 814 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1;
819 params->numOutputDataUnits = 0; 815 params->numOutputDataUnits = 0;
820 params->maxWidth = width; 816 params->maxWidth = ALIGN2(width, 4);
821 break; 817 break;
822 case DCE_TEST_MJPEG : 818 case DCE_TEST_MJPEG :
823 params = dce_alloc(sizeof(IJPEGVDEC_Params)); 819 params = dce_alloc(sizeof(IJPEGVDEC_Params));
@@ -829,7 +825,7 @@ int main(int argc, char * *argv)
829 params->maxBitRate = 10000000; 825 params->maxBitRate = 10000000;
830 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1; 826 params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1;
831 params->numOutputDataUnits = 1; 827 params->numOutputDataUnits = 1;
832 params->maxWidth = width; 828 params->maxWidth = ALIGN2(width, 4);
833 break; 829 break;
834 830
835 case DCE_TEST_MPEG2 : 831 case DCE_TEST_MPEG2 :
@@ -847,7 +843,7 @@ int main(int argc, char * *argv)
847 843
848 } 844 }
849 845
850 params->maxHeight = height; 846 params->maxHeight = ALIGN2(height, 4);
851 params->maxFrameRate = 30000; 847 params->maxFrameRate = 30000;
852 params->dataEndianness = XDM_BYTE; 848 params->dataEndianness = XDM_BYTE;
853 params->forceChromaFormat = XDM_YUV_420SP; 849 params->forceChromaFormat = XDM_YUV_420SP;