FFmpeg
Loading...
Searching...
No Matches
cavs_aec.h File Reference

Chinese AVS video (AVS1-P16, Broadcasting profile) AEC decoder. More...

#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/error.h"
#include "libavutil/macros.h"
#include "get_bits.h"

Go to the source code of this file.

Data Structures

struct  CAVSAECModel
 
struct  CAVSAECContext
 

Macros

#define CAVS_AEC_NUM_CTX   323
 
#define CAVS_AEC_LGPMPS_INIT   1023
 
#define CAVS_AEC_LGPMPS_MAX   1023
 
#define CAVS_AEC_LGPMPS_REFLECT   2047
 
#define CAVS_AEC_LGPMPS_BYPASS   1023
 
#define CAVS_AEC_LGPMPS_STUFF   4
 
#define CAVS_AEC_RT1_INIT   0xFF
 

Functions

static int ff_cavs_aec_ctx_idx (int start, int span, int inc)
 Table 51 start index + ctxIdxInc, or AVERROR_INVALIDDATA/AVERROR_BUG.
 
static void cavs_aec_update_ctx (CAVSAECModel *m, int bin)
 Adapt one context model after a bin has been decoded, 8.4.4.3.5.
 
static av_always_inline int cavs_aec_decode_bin (CAVSAECContext *aec, int pred_mps, int lg_pmps)
 Decode one bin (8.4.4.3.2); the caller supplies predMps and lgPmps.
 
void ff_cavs_aec_init (CAVSAECContext *aec, GetBitContext *gb)
 Reset all contexts and start the decoder on byte aligned gb (8.4.1).
 
static int ff_cavs_aec_decode_decision (CAVSAECContext *aec, int ctx_idx)
 Decode a bin with one context model (8.4.4.3.2).
 
static int ff_cavs_aec_decode_decision_w (CAVSAECContext *aec, int ctx_idx, int ctx_idx_w)
 Decode a bin with two weighted context models (8.4.4.3.2).
 
static int ff_cavs_aec_decode_bypass (CAVSAECContext *aec)
 Decode a bypass bin, fixed lgPmps (8.4.4.3.3).
 
static int ff_cavs_aec_decode_stuffing_bit (CAVSAECContext *aec)
 Decode aec_mb_stuffing_bit, fixed lgPmps (8.4.4.3.4).
 

Detailed Description

Chinese AVS video (AVS1-P16, Broadcasting profile) AEC decoder.

Definition in file cavs_aec.h.

Macro Definition Documentation

◆ CAVS_AEC_NUM_CTX

#define CAVS_AEC_NUM_CTX   323

◆ CAVS_AEC_LGPMPS_INIT

#define CAVS_AEC_LGPMPS_INIT   1023

Definition at line 69 of file cavs_aec.h.

Referenced by ff_cavs_aec_init().

◆ CAVS_AEC_LGPMPS_MAX

#define CAVS_AEC_LGPMPS_MAX   1023

Definition at line 70 of file cavs_aec.h.

Referenced by cavs_aec_update_ctx(), and ff_cavs_aec_decode_decision_w().

◆ CAVS_AEC_LGPMPS_REFLECT

#define CAVS_AEC_LGPMPS_REFLECT   2047

Definition at line 71 of file cavs_aec.h.

Referenced by cavs_aec_update_ctx().

◆ CAVS_AEC_LGPMPS_BYPASS

#define CAVS_AEC_LGPMPS_BYPASS   1023

Definition at line 72 of file cavs_aec.h.

Referenced by ff_cavs_aec_decode_bypass().

◆ CAVS_AEC_LGPMPS_STUFF

#define CAVS_AEC_LGPMPS_STUFF   4

Definition at line 73 of file cavs_aec.h.

Referenced by ff_cavs_aec_decode_stuffing_bit().

◆ CAVS_AEC_RT1_INIT

#define CAVS_AEC_RT1_INIT   0xFF

Definition at line 74 of file cavs_aec.h.

Referenced by ff_cavs_aec_init().

Function Documentation

◆ ff_cavs_aec_ctx_idx()

static int ff_cavs_aec_ctx_idx ( int start,
int span,
int inc )
inlinestatic

Table 51 start index + ctxIdxInc, or AVERROR_INVALIDDATA/AVERROR_BUG.

Definition at line 43 of file cavs_aec.h.

Referenced by decode_residual_block_aec().

◆ cavs_aec_update_ctx()

static void cavs_aec_update_ctx ( CAVSAECModel * m,
int bin )
inlinestatic

Adapt one context model after a bin has been decoded, 8.4.4.3.5.

Definition at line 77 of file cavs_aec.h.

Referenced by ff_cavs_aec_decode_decision(), and ff_cavs_aec_decode_decision_w().

◆ cavs_aec_decode_bin()

static av_always_inline int cavs_aec_decode_bin ( CAVSAECContext * aec,
int pred_mps,
int lg_pmps )
static

Decode one bin (8.4.4.3.2); the caller supplies predMps and lgPmps.

Definition at line 101 of file cavs_aec.h.

Referenced by ff_cavs_aec_decode_bypass(), ff_cavs_aec_decode_decision(), ff_cavs_aec_decode_decision_w(), and ff_cavs_aec_decode_stuffing_bit().

◆ ff_cavs_aec_init()

void ff_cavs_aec_init ( CAVSAECContext * aec,
GetBitContext * gb )

Reset all contexts and start the decoder on byte aligned gb (8.4.1).

Definition at line 36 of file cavs_aec.c.

Referenced by check_for_slice().

◆ ff_cavs_aec_decode_decision()

static int ff_cavs_aec_decode_decision ( CAVSAECContext * aec,
int ctx_idx )
inlinestatic

◆ ff_cavs_aec_decode_decision_w()

static int ff_cavs_aec_decode_decision_w ( CAVSAECContext * aec,
int ctx_idx,
int ctx_idx_w )
inlinestatic

Decode a bin with two weighted context models (8.4.4.3.2).

Definition at line 172 of file cavs_aec.h.

Referenced by decode_residual_block_aec().

◆ ff_cavs_aec_decode_bypass()

static int ff_cavs_aec_decode_bypass ( CAVSAECContext * aec)
inlinestatic

Decode a bypass bin, fixed lgPmps (8.4.4.3.3).

Definition at line 203 of file cavs_aec.h.

Referenced by aec_mv_diff(), and decode_residual_block_aec().

◆ ff_cavs_aec_decode_stuffing_bit()

static int ff_cavs_aec_decode_stuffing_bit ( CAVSAECContext * aec)
inlinestatic

Decode aec_mb_stuffing_bit, fixed lgPmps (8.4.4.3.4).

Definition at line 209 of file cavs_aec.h.

Referenced by decode_mb_pb_layer(), and decode_pic().