@ -33,7 +33,7 @@
# include "internal.h"
# include "video.h"
typedef struct ELBGContext {
typedef struct ELBGFilter Context {
const AVClass * class ;
AVLFG lfg ;
int64_t lfg_seed ;
@ -46,9 +46,9 @@ typedef struct ELBGContext {
const AVPixFmtDescriptor * pix_desc ;
uint8_t rgba_map [ 4 ] ;
int pal8 ;
} ELBGContext ;
} ELBGFilter Context ;
# define OFFSET(x) offsetof(ELBGContext, x)
# define OFFSET(x) offsetof(ELBGFilter Context, x)
# define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption elbg_options [ ] = {
@ -66,7 +66,7 @@ AVFILTER_DEFINE_CLASS(elbg);
static av_cold int init ( AVFilterContext * ctx )
{
ELBGContext * elbg = ctx - > priv ;
ELBGFilter Context * const elbg = ctx - > priv ;
if ( elbg - > pal8 & & elbg - > codebook_length > 256 ) {
av_log ( ctx , AV_LOG_ERROR , " pal8 output allows max 256 codebook length. \n " ) ;
@ -82,7 +82,7 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats ( AVFilterContext * ctx )
{
ELBGContext * elbg = ctx - > priv ;
ELBGFilter Context * const elbg = ctx - > priv ;
int ret ;
static const enum AVPixelFormat pix_fmts [ ] = {
@ -109,7 +109,7 @@ static int query_formats(AVFilterContext *ctx)
static int config_input ( AVFilterLink * inlink )
{
AVFilterContext * ctx = inlink - > dst ;
ELBGContext * elbg = ctx - > priv ;
ELBGFilter Context * const elbg = ctx - > priv ;
elbg - > pix_desc = av_pix_fmt_desc_get ( inlink - > format ) ;
elbg - > codeword_length = inlink - > w * inlink - > h ;
@ -140,7 +140,7 @@ static int config_input(AVFilterLink *inlink)
static int filter_frame ( AVFilterLink * inlink , AVFrame * frame )
{
ELBGContext * elbg = inlink - > dst - > priv ;
ELBGFilter Context * const elbg = inlink - > dst - > priv ;
int i , j , k ;
uint8_t * p , * p0 ;
@ -221,7 +221,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static av_cold void uninit ( AVFilterContext * ctx )
{
ELBGContext * elbg = ctx - > priv ;
ELBGFilter Context * const elbg = ctx - > priv ;
av_freep ( & elbg - > codebook ) ;
av_freep ( & elbg - > codeword ) ;
@ -248,7 +248,7 @@ static const AVFilterPad elbg_outputs[] = {
const AVFilter ff_vf_elbg = {
. name = " elbg " ,
. description = NULL_IF_CONFIG_SMALL ( " Apply posterize effect, using the ELBG algorithm. " ) ,
. priv_size = sizeof ( ELBGContext ) ,
. priv_size = sizeof ( ELBGFilter Context ) ,
. priv_class = & elbg_class ,
. query_formats = query_formats ,
. init = init ,