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
8 changes: 8 additions & 0 deletions app/oapv_app_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,17 @@ int main(int argc, const char **argv)
}
}

unsigned char bs_size[4];
oapv_bsw_write_direct(bs_size, stat.write, 32);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this function cannot be called from application code.
Please let me know what you want first.


/* store bitstream */
if(OAPV_SUCCEEDED(ret)) {
if(is_out && stat.write > 0) {
if(write_data(args_var->fname_out, bs_size, 4)) {
logerr("cannot write bitstream\n");
ret = -1;
goto ERR;
}
if(write_data(args_var->fname_out, bs_buf, stat.write)) {
logerr("cannot write bitstream\n");
ret = -1;
Expand Down
5 changes: 0 additions & 5 deletions src/oapv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,8 @@ 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)

oapv_bsw_write(bs, 0x61507631, 32); // signature ('aPv1')

Expand Down Expand Up @@ -1382,9 +1380,6 @@ 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) */

oapv_bsw_deinit(&ctx->bs); /* de-init BSW */
stat->write = bsw_get_write_byte(&ctx->bs);

Expand Down