/*
* FFV1 codec for libavcodec
*
- * Copyright (c) 2012 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2003-2012 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
*
#ifndef AVCODEC_FFV1_H
#define AVCODEC_FFV1_H
+
+#include <stdint.h>
+
#include "avcodec.h"
+#include "get_bits.h"
+#include "put_bits.h"
+#include "rangecoder.h"
#define MAX_PLANES 4
#define CONTEXT_SIZE 32
#define MAX_QUANT_TABLES 8
#define MAX_CONTEXT_INPUTS 5
+#define AC_GOLOMB_RICE 0
+#define AC_RANGE_DEFAULT_TAB 1
+#define AC_RANGE_CUSTOM_TAB 2
+
extern const uint8_t ff_log2_run[41];
extern const int8_t ffv1_quant5_10bit[256];
#define MAX_SLICES 256
typedef struct FFV1Context {
+ AVClass *class;
AVCodecContext *avctx;
RangeCoder c;
GetBitContext gb;
uint64_t rc_stat[256][2];
uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2];
int version;
+ int minor_version;
int width, height;
+ int chroma_planes;
int chroma_h_shift, chroma_v_shift;
+ int transparency;
int flags;
int picture_number;
- AVFrame picture;
+ int key_frame;
+ const AVFrame *frame;
+ AVFrame *last_picture;
+
+ AVFrame *cur;
int plane_count;
int ac; // 1 = range coder <-> 0 = golomb rice
+ int ac_byte_count; // number of bytes used for AC coding
PlaneContext plane[MAX_PLANES];
int16_t quant_table[MAX_CONTEXT_INPUTS][256];
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][256];
int run_index;
int colorspace;
int16_t *sample_buffer;
- int gob_count;
- int quant_table_count;
+ int ec;
+ int slice_damaged;
+ int key_frame_ok;
+ int context_model;
+
+ int bits_per_raw_sample;
+ int packed_at_lsb;
- DSPContext dsp;
+ int gob_count;
+ int quant_table_count;
struct FFV1Context *slice_context[MAX_SLICES];
int slice_count;
}
int ffv1_common_init(AVCodecContext *avctx);
-int ffv1_init_slice_state(FFV1Context *f);
+int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs);
int ffv1_init_slice_contexts(FFV1Context *f);
int ffv1_allocate_initial_states(FFV1Context *f);
-void ffv1_clear_state(FFV1Context *f);
+void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs);
int ffv1_close(AVCodecContext *avctx);
#endif /* AVCODEC_FFV1_H */