Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ add_test(NAME Encoder_runs COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_enc)
add_test(NAME Decoder_runs COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec)

# Test - encode
add_test(NAME encode COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_enc -i ${CMAKE_CURRENT_SOURCE_DIR}/test/sequence/pattern1_yuv422p10le_320x240_25fps.y4m -w 320 -h 240 -z 25 -o out.oapv)
add_test(NAME encode COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_enc -i ${CMAKE_CURRENT_SOURCE_DIR}/test/sequence/pattern1_yuv422p10le_320x240_25fps.y4m -o out.oapv)
set_tests_properties(encode PROPERTIES FAIL_REGULAR_EXPRESSION "Encoded frame count = 0")
set_tests_properties(encode PROPERTIES PASS_REGULAR_EXPRESSION "Encoded frame count = 125")

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The APV codec standard has the following features:
## How to use
### Encoder

Encoder as input require raw YUV file (422, 444), 10-bit or more.
Encoder as input require raw YCbCr file (422, 444), 10-bit or more.

Displaying help:

Expand Down
38 changes: 15 additions & 23 deletions app/oapv_app_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,34 +419,22 @@ int main(int argc, const char **argv)
if(fp_bs == NULL) {
logerr("ERROR: cannot open bitstream file = %s\n", args_var->fname_inp);
print_usage(argv);
return -1;
ret = -1; goto ERR;
}
/* open output file */
if(strlen(args_var->fname_out) > 0) {
char fext[16];
char *fname = (char *)args_var->fname_out;

if(strlen(fname) < 5) { /* at least x.yuv or x.y4m */
logerr("ERROR: invalide output file name\n");
return -1;
ret = check_file_name_type(args_var->fname_out);
if(ret > 0) {
is_y4m = 1;
}
strncpy(fext, fname + strlen(fname) - 3, sizeof(fext) - 1);
fext[0] = toupper(fext[0]);
fext[1] = toupper(fext[1]);
fext[2] = toupper(fext[2]);

if(strcmp(fext, "YUV") == 0) {
else if(ret == 0) {
is_y4m = 0;
}
else if(strcmp(fext, "Y4M") == 0) {
is_y4m = 1;
}
else {
logerr("ERROR: unknown output format\n");
ret = -1;
goto ERR;
else { // invalid or unknown file name type
logerr("unknown file type name for decoded video\n");
ret = -1; goto ERR;
}
clear_data(fname); /* remove decoded file contents if exists */
clear_data(args_var->fname_out); /* remove decoded file contents if exists */
}

// create bitstream buffer
Expand Down Expand Up @@ -609,10 +597,14 @@ int main(int argc, const char **argv)
if(write_y4m_header(args_var->fname_out, imgb_o)) {
logerr("cannot write Y4M header\n");
ret = -1;
goto END;
goto ERR;
}
}
write_dec_img(args_var->fname_out, imgb_o, is_y4m);
if(write_dec_img(args_var->fname_out, imgb_o, is_y4m)) {
logerr("cannot write decoded video\n");
ret = -1;
goto ERR;
}
}
frm_cnt[i]++;
}
Expand Down
Loading
Loading