2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
2012-11-30 01:36:10 +01:00
|
|
|
#ifndef VP9_DECODER_VP9_ONYXD_INT_H_
|
|
|
|
#define VP9_DECODER_VP9_ONYXD_INT_H_
|
2012-12-23 16:20:10 +01:00
|
|
|
#include "./vpx_config.h"
|
2012-12-19 00:31:19 +01:00
|
|
|
#include "vp9/decoder/vp9_onyxd.h"
|
2012-11-28 19:41:40 +01:00
|
|
|
#include "vp9/decoder/vp9_treereader.h"
|
2012-11-27 22:59:17 +01:00
|
|
|
#include "vp9/common/vp9_onyxc_int.h"
|
2012-11-28 19:41:40 +01:00
|
|
|
#include "vp9/decoder/vp9_dequantize.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
// #define DEC_DEBUG
|
2011-02-14 23:18:18 +01:00
|
|
|
|
2012-10-31 01:53:32 +01:00
|
|
|
typedef struct VP9Decompressor {
|
2012-07-14 00:21:29 +02:00
|
|
|
DECLARE_ALIGNED(16, MACROBLOCKD, mb);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 01:53:32 +01:00
|
|
|
DECLARE_ALIGNED(16, VP9_COMMON, common);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
VP9D_CONFIG oxcf;
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2013-04-02 22:34:20 +02:00
|
|
|
const uint8_t *source;
|
|
|
|
uint32_t source_sz;
|
2011-11-15 17:15:23 +01:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_reader *mbc;
|
2012-07-14 00:21:29 +02:00
|
|
|
int64_t last_time_stamp;
|
2013-04-02 22:34:20 +02:00
|
|
|
int ready_for_new_data;
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2013-01-15 22:49:44 +01:00
|
|
|
int refresh_frame_flags;
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_prob prob_skip_false;
|
2010-09-09 20:42:48 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
int decoded_key_frame;
|
2011-05-02 15:30:51 +02:00
|
|
|
|
Spatial resamping of ZEROMV predictors
This patch allows coding frames using references of different
resolution, in ZEROMV mode. For compound prediction, either
reference may be scaled.
To test, I use the resize_test and enable WRITE_RECON_BUFFER
in vp9_onyxd_if.c. It's also useful to apply this patch to
test/i420_video_source.h:
--- a/test/i420_video_source.h
+++ b/test/i420_video_source.h
@@ -93,6 +93,7 @@ class I420VideoSource : public VideoSource {
virtual void FillFrame() {
// Read a frame from input_file.
+ if (frame_ != 3)
if (fread(img_->img_data, raw_sz_, 1, input_file_) == 0) {
limit_ = frame_;
}
This forces the frame that the resolution changes on to be coded
with no motion, only scaling, and improves the quality of the
result.
Change-Id: I1ee75d19a437ff801192f767fd02a36bcbd1d496
2013-02-25 05:55:14 +01:00
|
|
|
int initial_width;
|
|
|
|
int initial_height;
|
2012-10-31 01:53:32 +01:00
|
|
|
} VP9D_COMP;
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2013-04-02 22:34:20 +02:00
|
|
|
int vp9_decode_frame(VP9D_COMP *cpi, const uint8_t **p_data_end);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
#if CONFIG_DEBUG
|
|
|
|
#define CHECK_MEM_ERROR(lval,expr) do {\
|
2012-07-14 00:21:29 +02:00
|
|
|
lval = (expr); \
|
|
|
|
if(!lval) \
|
|
|
|
vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
|
|
|
|
"Failed to allocate "#lval" at %s:%d", \
|
|
|
|
__FILE__,__LINE__);\
|
|
|
|
} while(0)
|
2010-05-18 17:58:33 +02:00
|
|
|
#else
|
|
|
|
#define CHECK_MEM_ERROR(lval,expr) do {\
|
2012-07-14 00:21:29 +02:00
|
|
|
lval = (expr); \
|
|
|
|
if(!lval) \
|
|
|
|
vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
|
|
|
|
"Failed to allocate "#lval);\
|
|
|
|
} while(0)
|
2010-05-18 17:58:33 +02:00
|
|
|
#endif
|
|
|
|
|
2012-12-19 00:31:19 +01:00
|
|
|
#endif // VP9_DECODER_VP9_TREEREADER_H_
|