Fix access unit delimiter.

- The nal header was written after the pic_type.
This commit is contained in:
Ari Koivula 2015-08-27 15:08:06 +03:00
parent 9584cd7352
commit 69d1059602

View file

@ -28,20 +28,16 @@
#include "nal.h"
static void encoder_state_write_bitstream_access_unit_delimiter(encoder_state_t * const state)
static void encoder_state_write_bitstream_aud(encoder_state_t * const state)
{
bitstream_t * const stream = &state->stream;
kvz_nal_write(stream, AUD_NUT, 0, 1);
uint8_t pic_type = state->global->slicetype == SLICE_I ? 0
: state->global->slicetype == SLICE_P ? 1
: 2;
WRITE_U(stream, pic_type, 3, "pic_type");
}
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_add_rbsp_trailing_bits(stream);
}