Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion inc/oapv.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ extern "C" {
#define OAPV_ERR_MALFORMED_BITSTREAM (-202)
#define OAPV_ERR_OUT_OF_BS_BUF (-203) /* too small bitstream buffer */
#define OAPV_ERR_NOT_FOUND (-204)
#define OAPV_ERR_FAILED_SYSCALL (-301) /* failed system call */
#define OAPV_ERR_FAILED_SYSCALL (-301) /* failed system call */
#define OAPV_ERR_INVALID_LEVEL (-401)
#define OAPV_ERR_INVALID_WIDTH (-405) /* invalid width (like odd) */
#define OAPV_ERR_UNKNOWN (-32767) /* unknown error */

/* return value checking */
Expand Down
3 changes: 3 additions & 0 deletions src/oapv_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ int oapve_param_update(oapve_ctx_t* ctx)
int ret = OAPV_OK;
int min_num_tiles = OAPV_MAX_TILES;
for (int i = 0; i < ctx->cdesc.max_num_frms; i++) {
if(ctx->cdesc.param[i].csp == 2 && ctx->cdesc.param[i].w & 0x1) { // check width restriction for 422
return OAPV_ERR_INVALID_WIDTH; // odd width is not spec-out
}
ret = enc_update_param_tile(ctx, &ctx->cdesc.param[i]);
oapv_assert_rv(ret == OAPV_OK, ret);
int num_tiles = oapv_div_round_up(ctx->w, ctx->cdesc.param[i].tile_w) * oapv_div_round_up(ctx->h, ctx->cdesc.param[i].tile_h);
Expand Down
2 changes: 1 addition & 1 deletion src/oapv_vlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ int oapvd_vlc_frame_info(oapv_bs_t *bs, oapv_fi_t *fi)
// check frame width in case of 422 format.
if(fi->chroma_format_idc == 2) {
// frame_width should be multiple of 2
oapv_assert_rv((fi->frame_width & 0x1) == 0, OAPV_ERR_MALFORMED_BITSTREAM);
oapv_assert_rv((fi->frame_width & 0x1) == 0, OAPV_ERR_INVALID_WIDTH);
}

return OAPV_OK;
Expand Down