summaryrefslogtreecommitdiff
path: root/libavcodec/vp8.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-23 02:01:41 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-28 03:49:54 +0200
commit6f7d3bde11b439da106e4226b7d115afded4086d (patch)
treeb80ff2a259077622b7f79512b64e45548273e5a5 /libavcodec/vp8.h
parent7ab9b30800c0847133fa23fc86d05029d0415fe2 (diff)
downloadffmpeg-6f7d3bde11b439da106e4226b7d115afded4086d.tar.gz
avcodec/vp8, vp9: Avoid using VP56mv and VP56Frame in VP8/9
Instead replace VP56mv by new and identical structures VP8mv and VP9mv. Also replace VP56Frame by VP8FrameType in vp8.h and use that in VP8 code. Also remove VP56_FRAME_GOLDEN2, as this has only been used by VP8, and use VP8_FRAME_ALTREF as replacement for its usage in VP8 as this is more in line with VP8 verbiage. This allows to remove all inclusions of vp56.h from everything that is not VP5/6. This also removes implicit inclusions of hpeldsp.h, h264chroma.h, vp3dsp.h and vp56dsp.h from all VP8/9 files. (This also fixes a build issue: If one compiles with -O0 and disables everything except the VP8-VAAPI encoder, the file containing ff_vpx_norm_shift is not compiled, yet this is used implicitly by vp56_rac_gets_nn() which is defined in vp56.h; it is unused by the VP8-VAAPI encoder and declared as av_unused, yet with -O0 unused noninline functions are not optimized away, leading to linking failures. With this patch, said function is not included in vaapi_encode_vp8.c any more.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vp8.h')
-rw-r--r--libavcodec/vp8.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index 9695111806..30aeb4cb06 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -34,12 +34,20 @@
#include "h264pred.h"
#include "threadframe.h"
-#include "vp56.h"
+#include "videodsp.h"
#include "vp8dsp.h"
#include "vpx_rac.h"
#define VP8_MAX_QUANT 127
+typedef enum {
+ VP8_FRAME_NONE = -1,
+ VP8_FRAME_CURRENT = 0,
+ VP8_FRAME_PREVIOUS = 1,
+ VP8_FRAME_GOLDEN = 2,
+ VP8_FRAME_ALTREF = 3,
+} VP8FrameType;
+
enum dct_token {
DCT_0,
DCT_1,
@@ -74,6 +82,11 @@ enum inter_splitmvmode {
VP8_SPLITMVMODE_NONE, ///< (only used in prediction) no split MVs
};
+typedef struct VP8mv {
+ DECLARE_ALIGNED(4, int16_t, x);
+ int16_t y;
+} VP8mv;
+
typedef struct VP8FilterStrength {
uint8_t filter_level;
uint8_t inner_limit;
@@ -91,8 +104,8 @@ typedef struct VP8Macroblock {
uint8_t segment;
uint8_t intra4x4_pred_mode_mb[16];
DECLARE_ALIGNED(4, uint8_t, intra4x4_pred_mode_top)[4];
- VP56mv mv;
- VP56mv bmv[16];
+ VP8mv mv;
+ VP8mv bmv[16];
} VP8Macroblock;
typedef struct VP8intmv {
@@ -235,10 +248,10 @@ typedef struct VP8Context {
/**
* filter strength adjustment for macroblocks that reference:
- * [0] - intra / VP56_FRAME_CURRENT
- * [1] - VP56_FRAME_PREVIOUS
- * [2] - VP56_FRAME_GOLDEN
- * [3] - altref / VP56_FRAME_GOLDEN2
+ * [0] - intra / VP8_FRAME_CURRENT
+ * [1] - VP8_FRAME_PREVIOUS
+ * [2] - VP8_FRAME_GOLDEN
+ * [3] - altref / VP8_FRAME_ALTREF
*/
int8_t ref[4];
} lf_delta;
@@ -283,8 +296,8 @@ typedef struct VP8Context {
VP8Macroblock *macroblocks_base;
int invisible;
- int update_last; ///< update VP56_FRAME_PREVIOUS with the current one
- int update_golden; ///< VP56_FRAME_NONE if not updated, or which frame to copy if so
+ int update_last; ///< update VP8_FRAME_PREVIOUS with the current one
+ int update_golden; ///< VP8_FRAME_NONE if not updated, or which frame to copy if so
int update_altref;
/**
@@ -329,8 +342,8 @@ typedef struct VP8Context {
/**
* Interframe DC prediction (VP7)
- * [0] VP56_FRAME_PREVIOUS
- * [1] VP56_FRAME_GOLDEN
+ * [0] VP8_FRAME_PREVIOUS
+ * [1] VP8_FRAME_GOLDEN
*/
uint16_t inter_dc_pred[2][2];