Skip to content

Commit

Permalink
Add NAL unit type to frame_info.
Browse files Browse the repository at this point in the history
  • Loading branch information
aryla committed Sep 28, 2015
1 parent 1c898a2 commit 8f404a3
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 68 deletions.
1 change: 1 addition & 0 deletions src/kvazaar.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ static void set_frame_info(kvz_frame_info *const info, const encoder_state_t *co
{
info->poc = state->global->poc,
info->qp = state->global->QP;
info->nal_unit_type = state->global->pictype;
info->slice_type = state->global->slicetype;
kvz_encoder_get_ref_lists(state, info->ref_list_len, info->ref_list);
}
Expand Down
69 changes: 69 additions & 0 deletions src/kvazaar.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,70 @@ typedef struct kvz_picture {
int64_t dts; //!< \brief Decompression timestamp.
} kvz_picture;

/**
* \brief NAL unit type codes.
*
* These are the nal_unit_type codes from Table 7-1 ITU-T H.265 v1.0.
*/
enum kvz_nal_unit_type {

// Trailing pictures

KVZ_NAL_TRAIL_N = 0,
KVZ_NAL_TRAIL_R = 1,

KVZ_NAL_TSA_N = 2,
KVZ_NAL_TSA_R = 3,

KVZ_NAL_STSA_N = 4,
KVZ_NAL_STSA_R = 5,

// Leading pictures

KVZ_NAL_RADL_N = 6,
KVZ_NAL_RADL_R = 7,

KVZ_NAL_RASL_N = 8,
KVZ_NAL_RASL_R = 9,

// Reserved non-IRAP RSV_VCL_N/R 10-15

// Intra random access point pictures

KVZ_NAL_BLA_W_LP = 16,
KVZ_NAL_BLA_W_RADL = 17,
KVZ_NAL_BLA_N_LP = 18,

KVZ_NAL_IDR_W_RADL = 19,
KVZ_NAL_IDR_N_LP = 20,

KVZ_NAL_CRA_NUT = 21,

// Reserved IRAP

KVZ_NAL_RSV_IRAP_VCL22 = 22,
KVZ_NAL_RSV_IRAP_VCL23 = 23,

// Reserved non-IRAP RSV_VCL 24-32

// non-VCL

KVZ_NAL_VPS_NUT = 32,
KVZ_NAL_SPS_NUT = 33,
KVZ_NAL_PPS_NUT = 34,

KVZ_NAL_AUD_NUT = 35,
KVZ_NAL_EOS_NUT = 36,
KVZ_NAL_EOB_NUT = 37,
KVZ_NAL_FD_NUT = 38,

KVZ_NAL_PREFIX_SEI_NUT = 39,
KVZ_NAL_SUFFIX_SEI_NUT = 40,

// Reserved RSV_NVCL 41-47
// Unspecified UNSPEC 48-63
};

enum kvz_slice_type {
KVZ_SLICE_B = 0,
KVZ_SLICE_P = 1,
Expand All @@ -212,6 +276,11 @@ typedef struct kvz_frame_info {
*/
int8_t qp;

/**
* \brief Type of the NAL VCL unit
*/
enum kvz_nal_unit_type nal_unit_type;

/**
* \brief Type of the slice
*/
Expand Down
68 changes: 0 additions & 68 deletions src/nal.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,74 +32,6 @@
#include "image.h"
#include "bitstream.h"


//////////////////////////////////////////////////////////////////////////
// TYPES

/**
* \brief NAL unit type codes.
*
* These are the nal_unit_type codes from Table 7-1 ITU-T H.265 v1.0.
*/
enum kvz_nal_unit_type {

// Trailing pictures

KVZ_NAL_TRAIL_N = 0,
KVZ_NAL_TRAIL_R = 1,

KVZ_NAL_TSA_N = 2,
KVZ_NAL_TSA_R = 3,

KVZ_NAL_STSA_N = 4,
KVZ_NAL_STSA_R = 5,

// Leading pictures

KVZ_NAL_RADL_N = 6,
KVZ_NAL_RADL_R = 7,

KVZ_NAL_RASL_N = 8,
KVZ_NAL_RASL_R = 9,

// Reserved non-IRAP RSV_VCL_N/R 10-15

// Intra random access point pictures

KVZ_NAL_BLA_W_LP = 16,
KVZ_NAL_BLA_W_RADL = 17,
KVZ_NAL_BLA_N_LP = 18,

KVZ_NAL_IDR_W_RADL = 19,
KVZ_NAL_IDR_N_LP = 20,

KVZ_NAL_CRA_NUT = 21,

// Reserved IRAP

KVZ_NAL_RSV_IRAP_VCL22 = 22,
KVZ_NAL_RSV_IRAP_VCL23 = 23,

// Reserved non-IRAP RSV_VCL 24-32

// non-VCL

KVZ_NAL_VPS_NUT = 32,
KVZ_NAL_SPS_NUT = 33,
KVZ_NAL_PPS_NUT = 34,

KVZ_NAL_AUD_NUT = 35,
KVZ_NAL_EOS_NUT = 36,
KVZ_NAL_EOB_NUT = 37,
KVZ_NAL_FD_NUT = 38,

KVZ_NAL_PREFIX_SEI_NUT = 39,
KVZ_NAL_SUFFIX_SEI_NUT = 40,

// Reserved RSV_NVCL 41-47
// Unspecified UNSPEC 48-63
};

#define SEI_HASH_MAX_LENGTH 4

//////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 8f404a3

Please sign in to comment.