aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaurabh Bipin Chandra2013-05-10 08:21:48 -0500
committerSaurabh Bipin Chandra2013-05-10 08:21:48 -0500
commit68e7d479772512e467d9f365f4c1caf56b14341a (patch)
treec9e012138e0caf4792a3fca3eb1b2f0d8d4eb849
parent6647d1f16d70b9d867ce5b7aef92705939aa5975 (diff)
downloadrepo-libdce-68e7d479772512e467d9f365f4c1caf56b14341a.tar.gz
repo-libdce-68e7d479772512e467d9f365f4c1caf56b14341a.tar.xz
repo-libdce-68e7d479772512e467d9f365f4c1caf56b14341a.zip
[DCE_TEST] Add Input argument to take in number of frames to write.
This patch lets dce_test app users mention the number of frames of the output raw data to be written to the output file as an extra input command line argument. To invoke dce_test app: dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler Change-Id: I311b5afbe56aedc93263777bc1891d71cdd73c9a Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
-rw-r--r--test_qnx/dce_test.c36
-rw-r--r--test_qnx/dce_test.use24
2 files changed, 33 insertions, 27 deletions
diff --git a/test_qnx/dce_test.c b/test_qnx/dce_test.c
index 805b240..6a6d6a1 100644
--- a/test_qnx/dce_test.c
+++ b/test_qnx/dce_test.c
@@ -93,7 +93,7 @@ enum {
93 * and write out raw (unstrided) nv12 frames (one per file). 93 * and write out raw (unstrided) nv12 frames (one per file).
94 */ 94 */
95 95
96int width, height, padded_width, padded_height, num_buffers, tiler; 96int width, height, frames_to_write, padded_width, padded_height, num_buffers, tiler;
97Engine_Handle engine = NULL; 97Engine_Handle engine = NULL;
98VIDDEC3_Handle codec = NULL; 98VIDDEC3_Handle codec = NULL;
99VIDDEC3_Params *params = NULL; 99VIDDEC3_Params *params = NULL;
@@ -605,14 +605,14 @@ int main(int argc, char * *argv)
605 oned = FALSE; 605 oned = FALSE;
606 } 606 }
607 607
608 if( argc != 8 ) { 608 if( argc != 9 ) {
609 printf("usage: %s width height framefile inpattern outpattern codec tilerbuffer\n", argv[0]); 609 printf("usage: %s width height frames_to_write framefile inpattern outpattern codec tilerbuffer\n", argv[0]);
610 printf("example: %s 320 240 frame.txt in.h264 out.yuv h264 tiler\n", argv[0]); 610 printf("example: %s 320 240 30 frame.txt in.h264 out.yuv h264 tiler\n", argv[0]);
611 printf("example: %s 640 480 frame.txt in.m4v out.yuv mpeg4 nontiler\n", argv[0]); 611 printf("example: %s 640 480 30 frame.txt in.m4v out.yuv mpeg4 nontiler\n", argv[0]);
612 printf("example: %s 720 480 frame.txt in.vc1 out.yuv vc1ap tiler\n", argv[0]); 612 printf("example: %s 720 480 30 frame.txt in.vc1 out.yuv vc1ap tiler\n", argv[0]);
613 printf("example: %s 320 240 frame.txt in.vc1 out.yuv vc1smp nontiler\n", argv[0]); 613 printf("example: %s 320 240 30 frame.txt in.vc1 out.yuv vc1smp nontiler\n", argv[0]);
614 printf("example: %s 1280 720 frame.txt in.bin out.yuv mjpeg tiler\n", argv[0]); 614 printf("example: %s 1280 720 30 frame.txt in.bin out.yuv mjpeg tiler\n", argv[0]);
615 printf("example: %s 1920 1088 frame.txt in.bin out.yuv mpeg2 nontiler\n", argv[0]); 615 printf("example: %s 1920 1088 30 frame.txt in.bin out.yuv mpeg2 nontiler\n", argv[0]);
616 printf("Currently supported codecs: h264, mpeg4, vc1ap, vc1smp, mjpeg, mpeg2\n"); 616 printf("Currently supported codecs: h264, mpeg4, vc1ap, vc1smp, mjpeg, mpeg2\n");
617 return (1); 617 return (1);
618 } 618 }
@@ -620,15 +620,21 @@ int main(int argc, char * *argv)
620 /* error checking? */ 620 /* error checking? */
621 width = atoi(argv[1]); 621 width = atoi(argv[1]);
622 height = atoi(argv[2]); 622 height = atoi(argv[2]);
623 frameData = argv[3]; 623 frames_to_write = atoi(argv[3]);
624 in_pattern = argv[4]; 624 frameData = argv[4];
625 out_pattern = argv[5]; 625 in_pattern = argv[5];
626 strcpy(vid_codec, argv[6]); 626 out_pattern = argv[6];
627 strcpy(tilerbuffer, argv[7]); 627 strcpy(vid_codec, argv[7]);
628 strcpy(tilerbuffer, argv[8]);
628 629
629 printf("Selected codec: %s\n", vid_codec); 630 printf("Selected codec: %s\n", vid_codec);
630 printf("Selected buffer: %s\n", tilerbuffer); 631 printf("Selected buffer: %s\n", tilerbuffer);
631 632
633 if( frames_to_write == -1 ) {
634 /* Default : 30 frames to write into output file */
635 frames_to_write = 30;
636 }
637
632 enum { 638 enum {
633 DCE_TEST_H264 = 1, 639 DCE_TEST_H264 = 1,
634 DCE_TEST_MPEG4 = 2, 640 DCE_TEST_MPEG4 = 2,
@@ -1348,7 +1354,7 @@ int main(int argc, char * *argv)
1348 buf = (OutputBuffer *)outArgs->outputID[i]; 1354 buf = (OutputBuffer *)outArgs->outputID[i];
1349 DEBUG("pop: %d (%p)", out_cnt, buf); 1355 DEBUG("pop: %d (%p)", out_cnt, buf);
1350 1356
1351 if( out_cnt < 30 ) { // write first 30 frames to output file out_cnt < 300 1357 if( out_cnt < frames_to_write ) { // write first 30 frames to output file out_cnt < 300
1352 write_output(out_pattern, out_cnt++, buf->buf + yoff, 1358 write_output(out_pattern, out_cnt++, buf->buf + yoff,
1353 buf->buf + uvoff, stride); 1359 buf->buf + uvoff, stride);
1354 } else { 1360 } else {
diff --git a/test_qnx/dce_test.use b/test_qnx/dce_test.use
index 413d849..9e511a1 100644
--- a/test_qnx/dce_test.use
+++ b/test_qnx/dce_test.use
@@ -12,27 +12,27 @@ Options:
12 12
13Examples: 13Examples:
141. decoding h.264 141. decoding h.264
15 dce_test width height framesize inpattern outpattern codec tiler/nontiler 15 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
16 dce_test 320 240 framesize.txt inputfile.h264 outputfile.yuv h264 tiler 16 dce_test 320 240 30 framesize.txt inputfile.h264 outputfile.yuv h264 tiler
17 17
182. decoding mpeg4 182. decoding mpeg4
19 dce_test width height framesize inpattern outpattern codec tiler/nontiler 19 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
20 dce_test 640 480 framesize.txt inputfile.m4v outputfile.yuv mpeg4 nontiler 20 dce_test 640 480 30 framesize.txt inputfile.m4v outputfile.yuv mpeg4 nontiler
21 21
223. decoding vc1ap 223. decoding vc1ap
23 dce_test width height framesize inpattern outpattern codec tiler/nontiler 23 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
24 dce_test 720 480 framesize.txt inputfile.vc1 outputfile.yuv vc1ap tiler 24 dce_test 720 480 30 framesize.txt inputfile.vc1 outputfile.yuv vc1ap tiler
25 25
264. decoding vc1smp 264. decoding vc1smp
27 dce_test width height framesize inpattern outpattern codec tiler/nontiler 27 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
28 dce_test 320 240 framesize.txt inputfile.vc1 outputfile.yuv vc1smp nontiler 28 dce_test 320 240 30 framesize.txt inputfile.vc1 outputfile.yuv vc1smp nontiler
29 29
305. decoding mjpeg 305. decoding mjpeg
31 dce_test width height framesize inpattern outpattern codec tiler/nontiler 31 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
32 dce_test 1280 720 framesize.txt inputfile.bin outputfile.yuv mjpeg tiler 32 dce_test 1280 720 30 framesize.txt inputfile.bin outputfile.yuv mjpeg tiler
33 33
346. decoding mpeg2 346. decoding mpeg2
35 dce_test width height framesize inpattern outpattern codec tiler/nontiler 35 dce_test width height frames_to_write framesize inpattern outpattern codec tiler/nontiler
36 dce_test 1920 1088 framesize.txt inputfile.bin outputfile.yuv mpeg2 nontiler 36 dce_test 1920 1088 30 framesize.txt inputfile.bin outputfile.yuv mpeg2 nontiler
37 37
38Currently supported codecs: h264, mpeg4, vc1ap, vc1smp, mjpeg, mpeg2 38Currently supported codecs: h264, mpeg4, vc1ap, vc1smp, mjpeg, mpeg2