FFmpeg
Macros | Functions
rtp_av1.h File Reference

shared defines and functions for AV1 RTP dec/enc More...

#include <stdint.h>
#include "libavutil/log.h"

Go to the source code of this file.

Macros

#define AV1B_OBU_FORBIDDEN   7
 
#define AV1F_OBU_FORBIDDEN   (1u << AV1B_OBU_FORBIDDEN)
 
#define AV1S_OBU_TYPE   3
 
#define AV1M_OBU_TYPE   15
 
#define AV1B_OBU_EXTENSION_FLAG   2
 
#define AV1F_OBU_EXTENSION_FLAG   (1u << AV1B_OBU_EXTENSION_FLAG)
 
#define AV1B_OBU_HAS_SIZE_FIELD   1
 
#define AV1F_OBU_HAS_SIZE_FIELD   (1u << AV1B_OBU_HAS_SIZE_FIELD)
 
#define AV1B_OBU_RESERVED_1BIT   0
 
#define AV1F_OBU_RESERVED_1BIT   (1u << AV1B_OBU_RESERVED_1BIT)
 
#define AV1B_AGGR_HDR_FRAG_CONT   7
 
#define AV1F_AGGR_HDR_FRAG_CONT   (1u << AV1B_AGGR_HDR_FRAG_CONT)
 
#define AV1B_AGGR_HDR_LAST_FRAG   6
 
#define AV1F_AGGR_HDR_LAST_FRAG   (1u << AV1B_AGGR_HDR_LAST_FRAG)
 
#define AV1S_AGGR_HDR_NUM_OBUS   4
 
#define AV1M_AGGR_HDR_NUM_OBUS   3
 
#define AV1B_AGGR_HDR_FIRST_PKT   3
 
#define AV1F_AGGR_HDR_FIRST_PKT   (1u << AV1B_AGGR_HDR_FIRST_PKT)
 

Functions

static unsigned int calc_leb_size (uint32_t length)
 calculate number of required LEB bytes for the given length More...
 
static unsigned int write_leb (uint8_t *lebptr, uint32_t length)
 write out variable number of LEB bytes for the given length More...
 
static void write_leb_n (uint8_t *lebptr, uint32_t length, unsigned int num_lebs)
 write out fixed number of LEB bytes (may have "unused" bytes) More...
 
static unsigned int parse_leb (void *logctx, const uint8_t *buf_ptr, uint32_t buffer_size, uint32_t *obu_size)
 securely parse LEB bytes and return the resulting encoded length More...
 

Detailed Description

shared defines and functions for AV1 RTP dec/enc

Author
Chris Hodges chris.nosp@m..hod.nosp@m.ges@a.nosp@m.xis..nosp@m.com

Definition in file rtp_av1.h.

Macro Definition Documentation

◆ AV1B_OBU_FORBIDDEN

#define AV1B_OBU_FORBIDDEN   7

Definition at line 37 of file rtp_av1.h.

◆ AV1F_OBU_FORBIDDEN

#define AV1F_OBU_FORBIDDEN   (1u << AV1B_OBU_FORBIDDEN)

Definition at line 38 of file rtp_av1.h.

◆ AV1S_OBU_TYPE

#define AV1S_OBU_TYPE   3

Definition at line 39 of file rtp_av1.h.

◆ AV1M_OBU_TYPE

#define AV1M_OBU_TYPE   15

Definition at line 40 of file rtp_av1.h.

◆ AV1B_OBU_EXTENSION_FLAG

#define AV1B_OBU_EXTENSION_FLAG   2

Definition at line 41 of file rtp_av1.h.

◆ AV1F_OBU_EXTENSION_FLAG

#define AV1F_OBU_EXTENSION_FLAG   (1u << AV1B_OBU_EXTENSION_FLAG)

Definition at line 42 of file rtp_av1.h.

◆ AV1B_OBU_HAS_SIZE_FIELD

#define AV1B_OBU_HAS_SIZE_FIELD   1

Definition at line 43 of file rtp_av1.h.

◆ AV1F_OBU_HAS_SIZE_FIELD

#define AV1F_OBU_HAS_SIZE_FIELD   (1u << AV1B_OBU_HAS_SIZE_FIELD)

Definition at line 44 of file rtp_av1.h.

◆ AV1B_OBU_RESERVED_1BIT

#define AV1B_OBU_RESERVED_1BIT   0

Definition at line 45 of file rtp_av1.h.

◆ AV1F_OBU_RESERVED_1BIT

#define AV1F_OBU_RESERVED_1BIT   (1u << AV1B_OBU_RESERVED_1BIT)

Definition at line 46 of file rtp_av1.h.

◆ AV1B_AGGR_HDR_FRAG_CONT

#define AV1B_AGGR_HDR_FRAG_CONT   7

Definition at line 48 of file rtp_av1.h.

◆ AV1F_AGGR_HDR_FRAG_CONT

#define AV1F_AGGR_HDR_FRAG_CONT   (1u << AV1B_AGGR_HDR_FRAG_CONT)

Definition at line 49 of file rtp_av1.h.

◆ AV1B_AGGR_HDR_LAST_FRAG

#define AV1B_AGGR_HDR_LAST_FRAG   6

Definition at line 50 of file rtp_av1.h.

◆ AV1F_AGGR_HDR_LAST_FRAG

#define AV1F_AGGR_HDR_LAST_FRAG   (1u << AV1B_AGGR_HDR_LAST_FRAG)

Definition at line 51 of file rtp_av1.h.

◆ AV1S_AGGR_HDR_NUM_OBUS

#define AV1S_AGGR_HDR_NUM_OBUS   4

Definition at line 52 of file rtp_av1.h.

◆ AV1M_AGGR_HDR_NUM_OBUS

#define AV1M_AGGR_HDR_NUM_OBUS   3

Definition at line 53 of file rtp_av1.h.

◆ AV1B_AGGR_HDR_FIRST_PKT

#define AV1B_AGGR_HDR_FIRST_PKT   3

Definition at line 54 of file rtp_av1.h.

◆ AV1F_AGGR_HDR_FIRST_PKT

#define AV1F_AGGR_HDR_FIRST_PKT   (1u << AV1B_AGGR_HDR_FIRST_PKT)

Definition at line 55 of file rtp_av1.h.

Function Documentation

◆ calc_leb_size()

static unsigned int calc_leb_size ( uint32_t  length)
inlinestatic

calculate number of required LEB bytes for the given length

Definition at line 58 of file rtp_av1.h.

Referenced by av1_handle_packet(), and ff_rtp_send_av1().

◆ write_leb()

static unsigned int write_leb ( uint8_t *  lebptr,
uint32_t  length 
)
inlinestatic

write out variable number of LEB bytes for the given length

Definition at line 68 of file rtp_av1.h.

Referenced by av1_handle_packet(), and ff_rtp_send_av1().

◆ write_leb_n()

static void write_leb_n ( uint8_t *  lebptr,
uint32_t  length,
unsigned int  num_lebs 
)
inlinestatic

write out fixed number of LEB bytes (may have "unused" bytes)

Definition at line 83 of file rtp_av1.h.

Referenced by ff_rtp_send_av1().

◆ parse_leb()

static unsigned int parse_leb ( void *  logctx,
const uint8_t *  buf_ptr,
uint32_t  buffer_size,
uint32_t *  obu_size 
)
inlinestatic

securely parse LEB bytes and return the resulting encoded length

Definition at line 95 of file rtp_av1.h.

Referenced by av1_handle_packet(), and ff_rtp_send_av1().