Skip to content

Commit c642fd5

Browse files
subhrajitm20kpchoi
andauthored
Error handling in encoder for width setting (AcademySoftwareFoundation#69)
* Error handling in encoder for width setting * For --input-csp 2, -w should be a multiple of 2 * move width check in encoder to check_conf() function * invalid configuration check of --input-csp 2 and -w non-multiple of 2 moved to the check_conf() function * Update readme (AcademySoftwareFoundation#67) * updated imhex screenshot compatible with version 4 Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> * updated README Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> * fixed invalid operation incase of y4m input Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> --------- Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> * Error handling in encoder for width setting * For --input-csp 2, -w should be a multiple of 2 Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> * move width check in encoder to check_conf() function * invalid configuration check of --input-csp 2 and -w non-multiple of 2 moved to the check_conf() function Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> * Enclosing check code in for loop of max_num_frms * This will allow flexible implementation of multiple frames encoding in near future Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> * Using existing for loop for handling invalid width Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> * Bug fix: updating FRM_IDX to loop parameter Signed-off-by: Subhrajit Mishra <84323996+subhrajitm20@users.noreply.github.com> --------- Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> Signed-off-by: subhrajitm20 <2003subhrajit@gmail.com> Signed-off-by: Subhrajit Mishra <84323996+subhrajitm20@users.noreply.github.com> Co-authored-by: kpchoi <kp5.choi@samsung.com>
1 parent 83a62cb commit c642fd5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/oapv_app_enc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ static int check_conf(oapve_cdesc_t *cdesc, args_var_t *vars)
326326
{
327327
int i;
328328
for(i = 0; i < cdesc->max_num_frms; i++) {
329+
// ensure frame width multiple of 2 in case of 422 format
330+
if ((vars->input_csp == 2) && (cdesc->param[i].w & 0x1)) {
331+
logerr("%d-th frame's width should be a multiple of 2 for '--input-csp 2'\n", i);
332+
return -1;
333+
}
329334
if(vars->hash && strlen(vars->fname_rec) == 0) {
330335
logerr("cannot use frame hash without reconstructed picture option!\n");
331336
return -1;

0 commit comments

Comments
 (0)