FFmpeg
Data Structures | Macros | Functions | Variables
bonk.c File Reference
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "bytestream.h"

Go to the source code of this file.

Data Structures

struct  BitCount
 
struct  BonkContext
 

Macros

#define BITSTREAM_READER_LE
 
#define LATTICE_SHIFT   10
 
#define SAMPLE_SHIFT   4
 
#define SAMPLE_FACTOR   (1 << SAMPLE_SHIFT)
 

Functions

static av_cold int bonk_close (AVCodecContext *avctx)
 
static av_cold int bonk_init (AVCodecContext *avctx)
 
static unsigned read_uint_max (BonkContext *s, uint32_t max)
 
static int intlist_read (BonkContext *s, int *buf, int entries, int base_2_part)
 
static int shift_down (int a, int b)
 
static int shift (int a, int b)
 
static int predictor_calc_error (int *k, int *state, int order, int error)
 
static void predictor_init_state (int *k, unsigned *state, int order)
 
static int bonk_decode (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
 

Variables

const FFCodec ff_bonk_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 26 of file bonk.c.

◆ LATTICE_SHIFT

#define LATTICE_SHIFT   10

Definition at line 267 of file bonk.c.

◆ SAMPLE_SHIFT

#define SAMPLE_SHIFT   4

Definition at line 268 of file bonk.c.

◆ SAMPLE_FACTOR

#define SAMPLE_FACTOR   (1 << SAMPLE_SHIFT)

Definition at line 269 of file bonk.c.

Function Documentation

◆ bonk_close()

static av_cold int bonk_close ( AVCodecContext avctx)
static

Definition at line 58 of file bonk.c.

◆ bonk_init()

static av_cold int bonk_init ( AVCodecContext avctx)
static

Definition at line 72 of file bonk.c.

◆ read_uint_max()

static unsigned read_uint_max ( BonkContext s,
uint32_t  max 
)
static

Definition at line 136 of file bonk.c.

Referenced by intlist_read().

◆ intlist_read()

static int intlist_read ( BonkContext s,
int buf,
int  entries,
int  base_2_part 
)
static

Definition at line 152 of file bonk.c.

Referenced by bonk_decode().

◆ shift_down()

static int shift_down ( int  a,
int  b 
)
inlinestatic

Definition at line 257 of file bonk.c.

Referenced by predictor_calc_error(), and predictor_init_state().

◆ shift()

static int shift ( int  a,
int  b 
)
inlinestatic

Definition at line 262 of file bonk.c.

Referenced by add_residual_for_joint_coding_chroma(), add_residual_joint(), add_vector_and_shift(), adpcm_decode_frame(), adpcm_encode_frame(), adpcm_ima_alp_expand_nibble(), adpcm_ima_expand_nibble(), adpcm_ima_wav_expand_nibble(), adpcm_sbpro_expand_nibble(), affine_merge_const6(), alf_filter_chroma(), alf_filter_luma(), apply_dependent_coupling_fixed(), apply_independent_coupling_fixed(), apply_prof_uni(), apply_prof_uni_w(), aptx_invert_quantization(), aptx_qmf_convolution(), aptx_qmf_polyphase_analysis(), aptx_qmf_polyphase_synthesis(), av_clip_intp2_rvi(), av_image_copy_to_buffer(), av_q2intfloat(), av_read_image_line2(), av_write_image_line2(), avf_read_packet(), avg(), bdof_fetch_samples(), bfi_decode_frame(), bidir_refine(), blend_pixel(), blend_pixel16(), block_angle(), bonk_decode(), bytestream2_get_levarint(), calc_predictor_params(), celt_autocorr(), check_decorrelate(), check_decorrelate_stereo(), chs_assemble_msbs_lsbs(), chs_get_lsb_width(), code_filter_coeffs(), combine_residual_frame(), conv_up(), convert_full_range(), copy_block(), copy_samples(), copyadd_block(), cri_decode_frame(), decode_bmv_frame(), decode_filter(), decode_frame(), decode_inter_plane(), decode_plane(), dequant(), determine_output_shift(), direct_search(), dither_color(), do_stereo(), dpcm_decode_frame(), dv_audio_12to16(), encode_frame(), encode_q_branch(), encode_residual_ch(), epzs_motion_search2(), epzs_motion_search_internal(), estimate_coeff(), estimate_motion_b(), estimate_sid_gain(), exponents_from_scale_factors(), extend_edges(), ff_acelp_weighted_vector_sum(), ff_adpcm_argo_expand_nibble(), ff_celp_lp_synthesis_filter(), ff_convert_matrix(), ff_dca_core_dequantize(), ff_dca_xll_filter_frame(), ff_draw_round_to_sub(), ff_estimate_p_frame_motion(), ff_gmc_c(), ff_h263_decode_motion(), ff_hevc_hls_residual_coding(), ff_hscale_16_to_15_lasx(), ff_hscale_16_to_19_lasx(), ff_ivi_inverse_haar_4x4(), ff_ivi_inverse_haar_8x8(), ff_jpegls_decode_lse(), ff_jpegls_decode_picture(), ff_line_noise_avg_c(), ff_line_noise_c(), ff_lpc_calc_coefs(), ff_nelly_get_sample_bits(), ff_png_pass_row_size(), ff_pre_estimate_p_frame_motion(), ff_print_debug_info2(), ff_qsv_map_pixfmt(), ff_sws_alphablendaway(), ff_thread_await_progress2(), ff_tta_filter_init(), ff_vc1_inv_trans_4x8_lasx(), ff_vc1_inv_trans_8x4_lasx(), ff_vvc_mmvd_offset_coding(), fic_idct(), fill_elements(), filter_3800(), flac_decorrelate_indep_c(), flac_decorrelate_ls_c(), flac_decorrelate_ms_c(), flac_decorrelate_rs_c(), flac_lpc_encode_c(), FUNC(), generate(), generate_grain_uv_c(), generate_grain_y_c(), generate_noise(), get_amv(), get_bucket(), get_value_cached(), h261_probe(), h263_mv4_search(), horizontal_compose_haari_TMPL(), horizontal_fill(), imdct_half_32(), imdct_half_64(), init_decoder(), init_dequant4_coeff_table(), init_dequant8_coeff_table(), init_sample_buffers(), initFilter(), interleave_TMPL(), itx_1d(), itx_2d(), jxl_u64(), l1_unscale(), l2_unscale_group(), librav1e_receive_packet(), lift(), liftS(), linear_scale_factor(), linemask_matches(), lmcs_derive_lut(), long_filter_high_3800(), long_term_filter(), lpc2lsp(), lpc_encode_choose_datapath(), lpc_encode_unrolled(), lsp_quantize(), lzss_decompress(), main(), mpeg4_decode_studio_block(), mpeg_decode_motion(), mpegaudiodec_common_init_static(), msmpeg4v2_decode_motion(), noise(), opengl_fill_color_map(), packed16togbra16(), parse_tonal(), permutate_in_line(), picmemset(), planar_rgb16_to_a(), planar_rgb16_to_uv(), planar_rgb16_to_y(), planar_rgb_to_uv_lasx(), planar_rgb_to_y_lasx(), planarCopyWrapper(), planarToP01xWrapper(), populate_distribution(), postprocess_chroma(), pred_dc_val(), pred_planar(), pred_residual_joint(), predict(), predict_intra(), predictor_decode_mono_3800(), predictor_decode_stereo_3800(), prefetch_motion(), premultiply16(), premultiply16offset(), premultiply16yuv(), print_stats(), process_frame(), prof_grad_filter(), ps_tableinit(), put_gpm(), put_hevc_epel_bi_h(), put_hevc_epel_bi_hv(), put_hevc_epel_bi_v(), put_hevc_epel_bi_w_h(), put_hevc_epel_bi_w_hv(), put_hevc_epel_bi_w_v(), put_hevc_pel_bi_pixels(), put_hevc_pel_bi_w_pixels(), put_hevc_qpel_bi_h(), put_hevc_qpel_bi_hv(), put_hevc_qpel_bi_v(), put_hevc_qpel_bi_w_h(), put_hevc_qpel_bi_w_hv(), put_hevc_qpel_bi_w_v(), put_uni_chroma_h(), put_uni_chroma_hv(), put_uni_chroma_v(), put_uni_chroma_w_h(), put_uni_chroma_w_hv(), put_uni_chroma_w_v(), put_uni_luma_h(), put_uni_luma_hv(), put_uni_luma_v(), put_uni_luma_w_h(), put_uni_luma_w_hv(), put_uni_luma_w_v(), put_uni_w_pixels(), put_vc1_mspel_mc_h_v_lasx(), put_vc1_mspel_mc_h_v_msa(), quantize(), quantize_lpc_coefs(), ra144_encode_frame(), radix_sort_pass(), range_decode_culshift(), read10in32(), read10in32_gray(), renorm(), renorm_cabac_decoder_once(), resolve_divisor(), round2(), run_psnr(), sab_diamond_search(), sao_band_filter(), sbc_unpack_frame(), sbr_hf_apply_noise(), sbr_hf_assemble(), sbr_hf_inverse_filter(), scale(), scale_clip(), scale_coefs(), set_filter(), set_major_params(), set_sample_rate_params(), shift_mono(), shift_stereo(), sign_extend(), sign_extend64(), signed_shift(), smc_encode_stream(), snow_horizontal_compose_lift_lead_out(), soft_thresholding(), softfloat_reciprocal(), sum_bits(), sws_getShiftedVec(), sws_shiftVec(), synth_grain_8x8_c(), transform_4x4_luma(), tta_filter_process_c(), ttaenc_filter_process_c(), unpack_10bit(), unpack_14(), update_initial_timestamps(), vc1_put_ver_16b_shift2_mmi(), vc2_encode_init(), vector_multiplication(), vector_rmultiplication(), vpx_rac_renorm(), vvc_h_loop_filter_chroma(), vvc_loop_filter_chroma(), vvc_v_loop_filter_chroma(), w_avg(), wavpack_encode_block(), wnv1_get_code(), write_element(), write_fat(), write_fat_sector(), wv_get_value_float(), xa_decode(), yuv2nv12cX_16_c_template(), yuv2p01xcX_c(), yuv2p01xl1_c(), yuv2p01xlX_c(), yuv2plane1_16_c_template(), yuv2plane1_float(), yuv2plane1_float_bswap_c_template(), yuv2plane1_float_c_template(), yuv2planeX_10_c_template(), yuv2planeX_16_c_template(), yuv2planeX_float_bswap_c_template(), and yuv2planeX_float_c_template().

◆ predictor_calc_error()

static int predictor_calc_error ( int k,
int state,
int  order,
int  error 
)
static

Definition at line 271 of file bonk.c.

Referenced by bonk_decode().

◆ predictor_init_state()

static void predictor_init_state ( int k,
unsigned *  state,
int  order 
)
static

Definition at line 292 of file bonk.c.

Referenced by bonk_decode().

◆ bonk_decode()

static int bonk_decode ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 306 of file bonk.c.

Variable Documentation

◆ ff_bonk_decoder

const FFCodec ff_bonk_decoder
Initial value:
= {
.p.name = "bonk",
CODEC_LONG_NAME("Bonk audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(BonkContext),
.close = bonk_close,
.p.capabilities = AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_SUBFRAMES |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
}

Definition at line 421 of file bonk.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
bonk_decode
static int bonk_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
Definition: bonk.c:306
BonkContext
Definition: bonk.c:35
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
bonk_init
static av_cold int bonk_init(AVCodecContext *avctx)
Definition: bonk.c:72
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_CODEC_ID_BONK
@ AV_CODEC_ID_BONK
Definition: codec_id.h:537
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
bonk_close
static av_cold int bonk_close(AVCodecContext *avctx)
Definition: bonk.c:58