Rename kvz_bitstream_align to kvz_bitstream_rbsp_trailing_bits.

- The syntax is called rbsp_trailing_bits in spec and 1 byte is added
  even when the bitstream is already aligned, so align is a bad name.
This commit is contained in:
Ari Koivula 2015-08-27 14:33:30 +03:00
parent 3a10e9e3e0
commit b2fb1b6d4a
4 changed files with 15 additions and 15 deletions

View file

@ -271,7 +271,7 @@ void kvz_bitstream_put(bitstream_t *const stream, const uint32_t data, uint8_t b
/**
* \brief Align the bitstream with one-bit padding
*/
void kvz_bitstream_align(bitstream_t * const stream)
void kvz_bitstream_add_rbsp_trailing_bits(bitstream_t * const stream)
{
kvz_bitstream_put(stream, 1, 1);
if ((stream->cur_bit & 7) != 0) {

View file

@ -79,7 +79,7 @@ void kvz_bitstream_put(bitstream_t *stream, uint32_t data, uint8_t bits);
#define bitstream_put_se(stream, data) { uint32_t index=(uint32_t)(((data)<=0)?(-(data))<<1:((data)<<1)-1); \
kvz_bitstream_put(stream,kvz_g_exp_table[index].value,kvz_g_exp_table[index].len); }
void kvz_bitstream_align(bitstream_t *stream);
void kvz_bitstream_add_rbsp_trailing_bits(bitstream_t *stream);
void kvz_bitstream_align_zero(bitstream_t *stream);
/* In debug mode print out some extra info */

View file

@ -42,7 +42,7 @@ static void encoder_state_write_bitstream_aud(encoder_state_t * const state)
bitstream_t * const stream = &state->stream;
encoder_state_write_bitstream_access_unit_delimiter(state);
kvz_nal_write(stream, AUD_NUT, 0, 1);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
}
static void encoder_state_write_bitstream_PTL(encoder_state_t * const state)
@ -543,7 +543,7 @@ static void encoder_state_write_active_parameter_sets_sei_message(encoder_state_
WRITE_UE(stream, layer_sps_idx, "layer_sps_idx");
//}
kvz_bitstream_align(stream); //rbsp_trailing_bits
kvz_bitstream_rbsp_trailing_bits(stream); //rbsp_trailing_bits
}
*/
@ -581,7 +581,7 @@ static void encoder_state_write_picture_timing_sei_message(encoder_state_t * con
WRITE_U(stream, source_scan_type, 2, "source_scan_type");
WRITE_U(stream, 0, 1, "duplicate_flag");
kvz_bitstream_align(stream); //rbsp_trailing_bits
kvz_bitstream_add_rbsp_trailing_bits(stream); //rbsp_trailing_bits
}
}
@ -802,7 +802,7 @@ static void add_checksum(encoder_state_t * const state)
CHECKPOINT("checksum[%d] = %u", i, checksum_val);
}
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
}
/**
@ -839,24 +839,24 @@ static void encoder_state_write_bitstream_main(encoder_state_t * const state)
// Video Parameter Set (VPS)
kvz_nal_write(stream, NAL_VPS_NUT, 0, 1);
encoder_state_write_bitstream_vid_parameter_set(state);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
// Sequence Parameter Set (SPS)
kvz_nal_write(stream, NAL_SPS_NUT, 0, 1);
encoder_state_write_bitstream_seq_parameter_set(state);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
// Picture Parameter Set (PPS)
kvz_nal_write(stream, NAL_PPS_NUT, 0, 1);
encoder_state_write_bitstream_pic_parameter_set(state);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
}
// Send Kvazaar version information only in the first frame.
if (state->global->frame == 0 && state->encoder_control->cfg->add_encoder_info) {
kvz_nal_write(stream, PREFIX_SEI_NUT, 0, first_nal_in_au);
encoder_state_write_bitstream_prefix_sei_version(state);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
}
//SEI messages for interlacing
@ -865,11 +865,11 @@ static void encoder_state_write_bitstream_main(encoder_state_t * const state)
// of HM decoder to accept bitstream
//kvz_nal_write(stream, PREFIX_SEI_NUT, 0, 0);
//encoder_state_write_active_parameter_sets_sei_message(state);
//kvz_bitstream_align(stream);
//kvz_bitstream_rbsp_trailing_bits(stream);
kvz_nal_write(stream, PREFIX_SEI_NUT, 0, 0);
encoder_state_write_picture_timing_sei_message(state);
kvz_bitstream_align(stream);
kvz_bitstream_add_rbsp_trailing_bits(stream);
}
{
@ -945,7 +945,7 @@ static void encoder_state_write_bitstream_tile(encoder_state_t * const state)
static void encoder_state_write_bitstream_slice(encoder_state_t * const state)
{
kvz_encoder_state_write_bitstream_slice_header(state);
kvz_bitstream_align(&state->stream);
kvz_bitstream_add_rbsp_trailing_bits(&state->stream);
encoder_state_write_bitstream_children(state);
}

View file

@ -268,7 +268,7 @@ static void encoder_state_worker_encode_lcu(void * opaque) {
//First LCU, and we are in a slice. We need a slice header
if (state->type == ENCODER_STATE_TYPE_SLICE && lcu->index == 0) {
kvz_encoder_state_write_bitstream_slice_header(state);
kvz_bitstream_align(&state->stream);
kvz_bitstream_add_rbsp_trailing_bits(&state->stream);
}
//Encode SAO
@ -1430,7 +1430,7 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
if (cur_cu->type == CU_PCM) {
kvz_cabac_encode_bin_trm(cabac, 1); // IPCMFlag == 1
kvz_cabac_finish(cabac);
kvz_bitstream_align(cabac.stream);
kvz_bitstream_add_rbsp_trailing_bits(cabac.stream);
// PCM sample
{
unsigned y, x;