Commit 6e719dc6 authored by Hendrik Leppkes's avatar Hendrik Leppkes

vp9: expose reference frames in VP9SharedContext

parent b95f241b
This diff is collapsed.
......@@ -26,6 +26,9 @@
#include <stdint.h>
#include "thread.h"
#include "vp56.h"
enum BlockLevel {
BL_64X64,
BL_32X32,
......@@ -115,6 +118,19 @@ enum CompPredMode {
PRED_SWITCHABLE,
};
struct VP9mvrefPair {
VP56mv mv[2];
int8_t ref[2];
};
typedef struct VP9Frame {
ThreadFrame tf;
AVBufferRef *extradata;
uint8_t *segmentation_map;
struct VP9mvrefPair *mv;
int uses_2pass;
} VP9Frame;
typedef struct VP9BitstreamHeader {
// bitstream header
uint8_t profile;
......@@ -181,6 +197,12 @@ typedef struct VP9BitstreamHeader {
typedef struct VP9SharedContext {
VP9BitstreamHeader h;
ThreadFrame refs[8];
#define CUR_FRAME 0
#define REF_FRAME_MVPAIR 1
#define REF_FRAME_SEGMAP 2
VP9Frame frames[3];
} VP9SharedContext;
#endif /* AVCODEC_VP9_H */
......@@ -36,14 +36,14 @@ static void FN(inter_pred)(AVCodecContext *ctx)
VP9Context *s = ctx->priv_data;
VP9Block *b = s->b;
int row = s->row, col = s->col;
ThreadFrame *tref1 = &s->refs[s->s.h.refidx[b->ref[0]]], *tref2;
ThreadFrame *tref1 = &s->s.refs[s->s.h.refidx[b->ref[0]]], *tref2;
AVFrame *ref1 = tref1->f, *ref2;
int w1 = ref1->width, h1 = ref1->height, w2, h2;
ptrdiff_t ls_y = s->y_stride, ls_uv = s->uv_stride;
int bytesperpixel = BYTES_PER_PIXEL;
if (b->comp) {
tref2 = &s->refs[s->s.h.refidx[b->ref[1]]];
tref2 = &s->s.refs[s->s.h.refidx[b->ref[1]]];
ref2 = tref2->f;
w2 = ref2->width;
h2 = ref2->height;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment