Skip to content
Closed
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 @@ -532,7 +532,6 @@ struct oapve_param {
int full_range_flag;
};

#define OAPV_CDESC_THREADS_AUTO 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the PR, and strictly speaking an API break.

/*****************************************************************************
* automatic assignment of number of threads in creation of encoder & decoder
*****************************************************************************/
Expand All @@ -549,6 +548,8 @@ struct oapve_cdesc {
int max_num_frms;
// max number of threads (or OAPV_CDESC_THREADS_AUTO for auto-assignment)
int threads;
// flag to disable 'raw bitstream format'
int disable_raw_bitstream_format;
// encoding parameters
oapve_param_t param[OAPV_MAX_NUM_FRAMES];
};
Expand Down
18 changes: 10 additions & 8 deletions src/oapv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,9 @@ int oapve_encode(oapve_t eid, oapv_frms_t *ifrms, oapvm_t mid, oapv_bitb_t *bitb
{
oapve_ctx_t *ctx;
oapv_frm_t *frm;
oapv_bs_t *bs;
oapv_bs_t *bs, bs_pbu_beg;
int i, ret;
u8 *bs_pos_pbu_beg, *bs_pos_au_beg;

ctx = enc_id_to_ctx(eid);
oapv_assert_rv(ctx != NULL && bitb->addr && bitb->bsize > 0, OAPV_ERR_INVALID_ARGUMENT);
Expand All @@ -1303,11 +1304,10 @@ int oapve_encode(oapve_t eid, oapv_frms_t *ifrms, oapvm_t mid, oapv_bitb_t *bitb
oapv_bsw_init(bs, bitb->addr, bitb->bsize, NULL);
oapv_mset(stat, 0, sizeof(oapve_stat_t));

u8 *bs_pos_au_beg = oapv_bsw_sink(bs); // address syntax of au size
u8 *bs_pos_pbu_beg;
oapv_bs_t bs_pbu_beg;
oapv_bsw_write(bs, 0, 32); // raw bitstream byte size (skip)

if(!ctx->cdesc.disable_raw_bitstream_format) {
bs_pos_au_beg = oapv_bsw_sink(bs); // address syntax of au size
oapv_bsw_write(bs, 0, 32); // raw bitstream byte size (skip)
}
oapv_bsw_write(bs, 0x61507631, 32); // signature ('aPv1')

for(i = 0; i < ifrms->num_frms; i++) {
Expand Down Expand Up @@ -1382,8 +1382,10 @@ int oapve_encode(oapve_t eid, oapv_frms_t *ifrms, oapvm_t mid, oapv_bitb_t *bitb
}
}

u32 au_size = (u32)((u8 *)oapv_bsw_sink(bs) - bs_pos_au_beg) - 4 /* au_size */;
oapv_bsw_write_direct(bs_pos_au_beg, au_size, 32); /* u(32) */
if(!ctx->cdesc.disable_raw_bitstream_format) {
u32 au_size = (u32)((u8 *)oapv_bsw_sink(bs) - bs_pos_au_beg) - 4;
oapv_bsw_write_direct(bs_pos_au_beg, au_size, 32);
}

oapv_bsw_deinit(&ctx->bs); /* de-init BSW */
stat->write = bsw_get_write_byte(&ctx->bs);
Expand Down
1 change: 0 additions & 1 deletion src/oapv_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ int oapve_param_default(oapve_param_t *param)
param->transfer_characteristics = 2; // unspecified transfer characteristics
param->matrix_coefficients = 2; // unspecified matrix coefficients
param->full_range_flag = 0; // limited range

return OAPV_OK;
}

Expand Down