diff options
author | Subash Lakkimsetti | 2016-04-06 15:21:55 -0500 |
---|---|---|
committer | Subash Lakkimsetti | 2016-04-06 15:21:55 -0500 |
commit | 4e9b02508ac3847df0af5c496a1be7b4ae082ad5 (patch) | |
tree | b61b1bbcc89f263a7238dbddc03d16dd4d92ae27 | |
parent | 868116b5e26534697b6a18c5fa466a01867076cf (diff) | |
download | hardware-ti-libdce-4e9b02508ac3847df0af5c496a1be7b4ae082ad5.tar.gz hardware-ti-libdce-4e9b02508ac3847df0af5c496a1be7b4ae082ad5.tar.xz hardware-ti-libdce-4e9b02508ac3847df0af5c496a1be7b4ae082ad5.zip |
[LIBDCE]: Fix in dce_enc_test when buffer type is tiler
In NUMROW case while reading input from file to buffer
Y & UV input read offsets are not configured correctly
Change-Id: Ice9f5e85201ba967aa485f6dc11723b3794eeb9c
Signed-off-by: Subash Lakkimsetti <x0091084@ti.com>
-rw-r--r-- | test_qnx/dce_enc_test/dce_enc_test.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/test_qnx/dce_enc_test/dce_enc_test.c b/test_qnx/dce_enc_test/dce_enc_test.c index 616859e..05b80bd 100644 --- a/test_qnx/dce_enc_test/dce_enc_test.c +++ b/test_qnx/dce_enc_test/dce_enc_test.c | |||
@@ -406,10 +406,18 @@ static const char *get_path(const char *pattern, int cnt) | |||
406 | 406 | ||
407 | int read_partial_input(const char *pattern, int cnt, char *input, int rowmode, int numBlock) | 407 | int read_partial_input(const char *pattern, int cnt, char *input, int rowmode, int numBlock) |
408 | { | 408 | { |
409 | int sz = 0, n = 0, num_planes, i, buf_height; | 409 | int sz = 0, n = 0, num_planes, i, buf_height,uv_max,y_max; |
410 | char *input_y = (char *) ((int) input + dest_y_offset); | 410 | char *input_y = (char *) ((int) input + dest_y_offset); |
411 | char *input_uv = (char *) ((int) input + dest_uv_offset); | 411 | char *input_uv = (char *) ((int) input + dest_uv_offset); |
412 | 412 | ||
413 | if( tiler ) { | ||
414 | uv_max = 4096 * height * 1.5; | ||
415 | y_max = 4096 * height; | ||
416 | } else { | ||
417 | uv_max = width * height * 1.5; | ||
418 | y_max = width * height; | ||
419 | } | ||
420 | |||
413 | const char *path = get_path(pattern, cnt); | 421 | const char *path = get_path(pattern, cnt); |
414 | if( path == NULL ) { | 422 | if( path == NULL ) { |
415 | return (sz); | 423 | return (sz); |
@@ -437,7 +445,7 @@ int read_partial_input(const char *pattern, int cnt, char *input, int rowmode, i | |||
437 | 445 | ||
438 | for( i = 0; i < buf_height; i++ ) { | 446 | for( i = 0; i < buf_height; i++ ) { |
439 | if( num_planes ) { // UV location - num_plane = 1 | 447 | if( num_planes ) { // UV location - num_plane = 1 |
440 | if( dest_uv_offset < (width * height * 1.5) ) { | 448 | if( dest_uv_offset < uv_max ) { |
441 | lseek(fd, input_uv_offset, SEEK_SET); | 449 | lseek(fd, input_uv_offset, SEEK_SET); |
442 | n = read(fd, input_uv , width); | 450 | n = read(fd, input_uv , width); |
443 | if( n ) { | 451 | if( n ) { |
@@ -461,7 +469,7 @@ int read_partial_input(const char *pattern, int cnt, char *input, int rowmode, i | |||
461 | //DEBUGLOW("dest_uv_offset %d >= width * height * 1.5 %d", (int)dest_uv_offset, (int) (width * height * 1.5)); | 469 | //DEBUGLOW("dest_uv_offset %d >= width * height * 1.5 %d", (int)dest_uv_offset, (int) (width * height * 1.5)); |
462 | } | 470 | } |
463 | } else { // Y location - num_plane = 0 | 471 | } else { // Y location - num_plane = 0 |
464 | if( dest_y_offset < (width * height) ) { | 472 | if( dest_y_offset < y_max ) { |
465 | lseek(fd, input_y_offset, SEEK_SET); | 473 | lseek(fd, input_y_offset, SEEK_SET); |
466 | n = read(fd, input_y , width); | 474 | n = read(fd, input_y , width); |
467 | if( n ) { | 475 | if( n ) { |
@@ -1445,11 +1453,7 @@ int main(int argc, char * *argv) | |||
1445 | #endif | 1453 | #endif |
1446 | 1454 | ||
1447 | if (datamode == IVIDEO_NUMROWS) { | 1455 | if (datamode == IVIDEO_NUMROWS) { |
1448 | if( tiler ) { | 1456 | input_uv_offset = input_y_offset + (width * height); |
1449 | input_uv_offset = input_y_offset + (4096 * height); | ||
1450 | } else { | ||
1451 | input_uv_offset = input_y_offset + (width * height); | ||
1452 | } | ||
1453 | DEBUG("input_y_offset %d input_uv_offset %d ", input_y_offset, input_uv_offset); | 1457 | DEBUG("input_y_offset %d input_uv_offset %d ", input_y_offset, input_uv_offset); |
1454 | } | 1458 | } |
1455 | 1459 | ||
@@ -1772,13 +1776,8 @@ int main(int argc, char * *argv) | |||
1772 | 1776 | ||
1773 | if (datamode == IVIDEO_NUMROWS) { | 1777 | if (datamode == IVIDEO_NUMROWS) { |
1774 | // Reset to the next frame; when VIDENC2_process return; 1 input frame should be encoded. | 1778 | // Reset to the next frame; when VIDENC2_process return; 1 input frame should be encoded. |
1775 | if( tiler ) { | 1779 | input_y_offset += (width * height/2); |
1776 | input_y_offset += (4096 * height/2); | 1780 | input_uv_offset += (width * height); |
1777 | input_uv_offset += (4096 * height); | ||
1778 | } else { | ||
1779 | input_y_offset += (width * height/2); | ||
1780 | input_uv_offset += (width * height); | ||
1781 | } | ||
1782 | DEBUG("input_y_offset %d input_uv_offset %d", input_y_offset, input_uv_offset); | 1781 | DEBUG("input_y_offset %d input_uv_offset %d", input_y_offset, input_uv_offset); |
1783 | } | 1782 | } |
1784 | } | 1783 | } |