FFmpeg
Loading...
Searching...
No Matches
api-hevc-mp4toannexb-test.c File Reference
#include <stdio.h>
#include <string.h>
#include "libavutil/error.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bsf.h"
#include "libavcodec/packet.h"

Go to the source code of this file.

Data Structures

struct  HVCCNALDesc
 

Functions

static void print_packet_hex (const char *label, const AVPacket *pkt)
 
static uint8_t * build_hvcc (size_t *hvcc_size, const HVCCNALDesc *arrays, int nb_arrays)
 
static int build_packet (AVPacket *pkt, const uint8_t *nalus[], const size_t lens[], int count)
 
static int decode_packet (const AVPacket *pkt)
 
static int run_test_case (const char *case_name, const uint8_t *hvcc, size_t hvcc_size, AVPacket *in_pkt, int init_only, int check_decode)
 
int main (void)
 

Variables

static const uint8_t vps_bytes []
 
static const uint8_t sps_bytes []
 
static const uint8_t sps1_bytes []
 
static const uint8_t pps0_bytes []
 
static const uint8_t pps1_bytes []
 
static const uint8_t prefix_sei_bytes []
 
static const uint8_t dummy_sei_bytes []
 
static const uint8_t idr_slice_bytes []
 
static const uint8_t hvcc_header [22]
 

Function Documentation

◆ print_packet_hex()

static void print_packet_hex ( const char * label,
const AVPacket * pkt )
static

Definition at line 107 of file api-hevc-mp4toannexb-test.c.

Referenced by run_test_case().

◆ build_hvcc()

static uint8_t * build_hvcc ( size_t * hvcc_size,
const HVCCNALDesc * arrays,
int nb_arrays )
static

Definition at line 116 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ build_packet()

static int build_packet ( AVPacket * pkt,
const uint8_t * nalus[],
const size_t lens[],
int count )
static

Definition at line 156 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ decode_packet()

static int decode_packet ( const AVPacket * pkt)
static

Definition at line 180 of file api-hevc-mp4toannexb-test.c.

Referenced by run_test_case().

◆ run_test_case()

static int run_test_case ( const char * case_name,
const uint8_t * hvcc,
size_t hvcc_size,
AVPacket * in_pkt,
int init_only,
int check_decode )
static

Definition at line 245 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ main()

int main ( void )

Definition at line 325 of file api-hevc-mp4toannexb-test.c.

Variable Documentation

◆ vps_bytes

const uint8_t vps_bytes[]
static
Initial value:
= {
0x40, 0x01, 0x0c, 0x01, 0xff, 0xff, 0x03, 0x70,
0x00, 0x00, 0x03, 0x00, 0x90, 0x00, 0x00, 0x03,
0x00, 0x00, 0x03, 0x00, 0x1e, 0x95, 0x94, 0x09
}

Definition at line 35 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ sps_bytes

const uint8_t sps_bytes[]
static
Initial value:
= {
0x42, 0x01, 0x01, 0x03, 0x70, 0x00, 0x00, 0x03,
0x00, 0x90, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03,
0x00, 0x1e, 0xa0, 0x20, 0x81, 0x05, 0x96, 0x56,
0x54, 0xa4, 0xc2, 0xe0, 0x10, 0x00, 0x00, 0x3e,
0x80, 0x00, 0x00, 0x3e, 0x80, 0x80
}

Definition at line 41 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ sps1_bytes

const uint8_t sps1_bytes[]
static
Initial value:
= {
0x42, 0x01, 0x01, 0x03, 0x70, 0x00, 0x00, 0x03,
0x00, 0x90, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03,
0x00, 0x1e, 0x48, 0x08, 0x20, 0x41, 0x65, 0x95,
0x95, 0x29, 0x30, 0xb8, 0x04, 0x00, 0x00, 0x0f,
0xa0, 0x00, 0x00, 0x0f, 0xa0, 0x20
}

Definition at line 51 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ pps0_bytes

const uint8_t pps0_bytes[]
static
Initial value:
= {
0x44, 0x01, 0xc0, 0x73, 0xc0, 0x89
}

Definition at line 60 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ pps1_bytes

const uint8_t pps1_bytes[]
static
Initial value:
= {
0x44, 0x01, 0x50, 0x1c, 0xf0, 0x22, 0x40
}

Definition at line 65 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ prefix_sei_bytes

const uint8_t prefix_sei_bytes[]
static
Initial value:
= {
0x4e, 0x01, 0x03, 0x01, 0xff, 0x80
}

Definition at line 70 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ dummy_sei_bytes

const uint8_t dummy_sei_bytes[]
static
Initial value:
= {
0x4e, 0x01
}

Definition at line 75 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ idr_slice_bytes

const uint8_t idr_slice_bytes[]
static
Initial value:
= {
0x28, 0x01, 0xac, 0x4e, 0xd7, 0x1f, 0xff, 0xf5,
0xde, 0x9c, 0xaf, 0xea, 0xf8
}

Definition at line 80 of file api-hevc-mp4toannexb-test.c.

Referenced by main().

◆ hvcc_header

const uint8_t hvcc_header[22]
static
Initial value:
= {
1,
0x01,
0x60, 0, 0, 0,
0x90, 0, 0, 0, 0, 0,
0x5d,
0xf0, 0x00,
0xfc,
0xfd,
0xf8,
0xf8,
0x00, 0x00,
0x03
}

Definition at line 85 of file api-hevc-mp4toannexb-test.c.

Referenced by build_hvcc().