summaryrefslogtreecommitdiff
path: root/libavcodec/cavs.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-12-27 17:12:10 +0100
committerAnton Khirnov <anton@khirnov.net>2012-12-30 18:48:11 +0100
commit7d8482640058d66867602a6f58446c9342d9d146 (patch)
tree852375c0392b027280299cede76ccd045217690f /libavcodec/cavs.h
parent64bb3fa6b7f5b2db22b7577585d5861be24eebd8 (diff)
cavs: deMpegEncContextize
It does not use any of the mpegvideo infrastructure, just a few fields from the context. Fixes a segfault with the emu edge flag, since emu edge buffer is now allocated as a part of the frame buffer allocation and cavs calls ff_get_buffer() directly, it does not use mpegvideo buffer management. Fixes a memleak of the last frame.
Diffstat (limited to 'libavcodec/cavs.h')
-rw-r--r--libavcodec/cavs.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h
index 2e43124927..2032441351 100644
--- a/libavcodec/cavs.h
+++ b/libavcodec/cavs.h
@@ -22,9 +22,10 @@
#ifndef AVCODEC_CAVS_H
#define AVCODEC_CAVS_H
-#include "dsputil.h"
-#include "mpegvideo.h"
#include "cavsdsp.h"
+#include "dsputil.h"
+#include "get_bits.h"
+#include "videodsp.h"
#define SLICE_MAX_START_CODE 0x000001af
#define EXT_START_CODE 0x000001b5
@@ -152,15 +153,25 @@ struct dec_2dvlc {
int8_t max_run;
};
+typedef struct AVSFrame {
+ AVFrame *f;
+ int poc;
+} AVSFrame;
+
typedef struct AVSContext {
- MpegEncContext s;
- CAVSDSPContext cdsp;
- Picture picture; ///< currently decoded frame
- Picture DPB[2]; ///< reference frames
+ AVCodecContext *avctx;
+ DSPContext dsp;
+ VideoDSPContext vdsp;
+ CAVSDSPContext cdsp;
+ GetBitContext gb;
+ AVSFrame cur; ///< currently decoded frame
+ AVSFrame DPB[2]; ///< reference frames
int dist[2]; ///< temporal distances from current frame to ref frames
+ int low_delay;
int profile, level;
int aspect_ratio;
int mb_width, mb_height;
+ int width, height;
int pic_type;
int stream_revision; ///<0 for samples from 2006, 1 for rm52j encoder
int progressive;
@@ -221,6 +232,8 @@ typedef struct AVSContext {
int direct_den[2]; ///< for scaling in direct B block
int scale_den[2]; ///< for scaling neighbouring MVs
+ uint8_t *edge_emu_buffer;
+
int got_keyframe;
DCTELEM *block;
} AVSContext;