OpenFFmpeg
Classes | Macros | Typedefs | Functions
rangecoder.h File Reference

Range coder. More...

#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Classes

struct  RangeCoder
 

Macros

#define MAX_OVERREAD   2
 

Typedefs

typedef struct RangeCoder RangeCoder
 

Functions

void ff_init_range_encoder (RangeCoder *c, uint8_t *buf, int buf_size)
 
void ff_init_range_decoder (RangeCoder *c, const uint8_t *buf, int buf_size)
 
int ff_rac_terminate (RangeCoder *c, int version)
 Terminates the range coder. More...
 
int ff_rac_check_termination (RangeCoder *c, int version)
 Check if at the current position there is a valid looking termination. More...
 
void ff_build_rac_states (RangeCoder *c, int factor, int max_p)
 

Detailed Description

Range coder.

Function Documentation

§ ff_rac_check_termination()

int ff_rac_check_termination ( RangeCoder c,
int  version 
)

Check if at the current position there is a valid looking termination.

Parameters
versionversion 0 requires the decoder to know the data size in bytes version 1 needs about 1 bit more space but does not need to carry the size from encoder to decoder
Returns
negative AVERROR code on error or non negative.

§ ff_rac_terminate()

int ff_rac_terminate ( RangeCoder c,
int  version 
)

Terminates the range coder.

Parameters
versionversion 0 requires the decoder to know the data size in bytes version 1 needs about 1 bit more space but does not need to carry the size from encoder to decoder