Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Guillaume Martres
aom-rav1e
Commits
bbea7c95
Commit
bbea7c95
authored
May 28, 2015
by
Scott LaVarnway
Committed by
Gerrit Code Review
May 28, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Re-worked header files"
parents
a927aec5
b962646f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
97 additions
and
84 deletions
+97
-84
test/dct16x16_test.cc
test/dct16x16_test.cc
+1
-0
test/fdct8x8_test.cc
test/fdct8x8_test.cc
+1
-0
test/vp9_error_block_test.cc
test/vp9_error_block_test.cc
+1
-0
test/vp9_quantize_test.cc
test/vp9_quantize_test.cc
+2
-0
vp9/common/vp9_blockd.h
vp9/common/vp9_blockd.h
+24
-49
vp9/common/vp9_entropy.h
vp9/common/vp9_entropy.h
+8
-25
vp9/common/vp9_entropymode.h
vp9/common/vp9_entropymode.h
+5
-10
vp9/common/vp9_enums.h
vp9/common/vp9_enums.h
+38
-0
vp9/common/vp9_scan.h
vp9/common/vp9_scan.h
+12
-0
vp9/decoder/vp9_detokenize.c
vp9/decoder/vp9_detokenize.c
+1
-0
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_encodemb.c
+1
-0
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_pickmode.c
+1
-0
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_rdopt.c
+1
-0
vp9/encoder/vp9_tokenize.c
vp9/encoder/vp9_tokenize.c
+1
-0
No files found.
test/dct16x16_test.cc
View file @
bbea7c95
...
...
@@ -20,6 +20,7 @@
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
...
...
test/fdct8x8_test.cc
View file @
bbea7c95
...
...
@@ -20,6 +20,7 @@
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
...
...
test/vp9_error_block_test.cc
View file @
bbea7c95
...
...
@@ -21,6 +21,7 @@
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
using
libvpx_test
::
ACMRandom
;
...
...
test/vp9_quantize_test.cc
View file @
bbea7c95
...
...
@@ -21,6 +21,8 @@
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
using
libvpx_test
::
ACMRandom
;
...
...
vp9/common/vp9_blockd.h
View file @
bbea7c95
...
...
@@ -18,74 +18,28 @@
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_common_data.h"
#include "vp9/common/vp9_filter.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_scale.h"
#include "vp9/common/vp9_seg_common.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#define BLOCK_SIZE_GROUPS 4
#define SKIP_CONTEXTS 3
#define INTER_MODE_CONTEXTS 7
/* Segment Feature Masks */
#define MAX_MV_REF_CANDIDATES 2
#define INTRA_INTER_CONTEXTS 4
#define COMP_INTER_CONTEXTS 5
#define REF_CONTEXTS 5
typedef
enum
{
PLANE_TYPE_Y
=
0
,
PLANE_TYPE_UV
=
1
,
PLANE_TYPES
}
PLANE_TYPE
;
#define MAX_MB_PLANE 3
typedef
char
ENTROPY_CONTEXT
;
static
INLINE
int
combine_entropy_contexts
(
ENTROPY_CONTEXT
a
,
ENTROPY_CONTEXT
b
)
{
return
(
a
!=
0
)
+
(
b
!=
0
);
}
typedef
enum
{
KEY_FRAME
=
0
,
INTER_FRAME
=
1
,
FRAME_TYPES
,
}
FRAME_TYPE
;
typedef
enum
{
DC_PRED
,
// Average of above and left pixels
V_PRED
,
// Vertical
H_PRED
,
// Horizontal
D45_PRED
,
// Directional 45 deg = round(arctan(1/1) * 180/pi)
D135_PRED
,
// Directional 135 deg = 180 - 45
D117_PRED
,
// Directional 117 deg = 180 - 63
D153_PRED
,
// Directional 153 deg = 180 - 27
D207_PRED
,
// Directional 207 deg = 180 + 27
D63_PRED
,
// Directional 63 deg = round(arctan(2/1) * 180/pi)
TM_PRED
,
// True-motion
NEARESTMV
,
NEARMV
,
ZEROMV
,
NEWMV
,
MB_MODE_COUNT
}
PREDICTION_MODE
;
static
INLINE
int
is_inter_mode
(
PREDICTION_MODE
mode
)
{
return
mode
>=
NEARESTMV
&&
mode
<=
NEWMV
;
}
#define INTRA_MODES (TM_PRED + 1)
#define INTER_MODES (1 + NEWMV - NEARESTMV)
#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
/* For keyframes, intra block modes are predicted by the (already decoded)
modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */
...
...
@@ -281,6 +235,27 @@ static INLINE BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize,
return
ss_size_lookup
[
bsize
][
pd
->
subsampling_x
][
pd
->
subsampling_y
];
}
static
INLINE
void
reset_skip_context
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE
bsize
)
{
int
i
;
for
(
i
=
0
;
i
<
MAX_MB_PLANE
;
i
++
)
{
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
i
];
const
BLOCK_SIZE
plane_bsize
=
get_plane_block_size
(
bsize
,
pd
);
memset
(
pd
->
above_context
,
0
,
sizeof
(
ENTROPY_CONTEXT
)
*
num_4x4_blocks_wide_lookup
[
plane_bsize
]);
memset
(
pd
->
left_context
,
0
,
sizeof
(
ENTROPY_CONTEXT
)
*
num_4x4_blocks_high_lookup
[
plane_bsize
]);
}
}
static
INLINE
const
vp9_prob
*
get_y_mode_probs
(
const
MODE_INFO
*
mi
,
const
MODE_INFO
*
above_mi
,
const
MODE_INFO
*
left_mi
,
int
block
)
{
const
PREDICTION_MODE
above
=
vp9_above_block_mode
(
mi
,
above_mi
,
block
);
const
PREDICTION_MODE
left
=
vp9_left_block_mode
(
mi
,
left_mi
,
block
);
return
vp9_kf_y_mode_prob
[
above
][
left
];
}
typedef
void
(
*
foreach_transformed_block_visitor
)(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
...
...
vp9/common/vp9_entropy.h
View file @
bbea7c95
...
...
@@ -14,8 +14,8 @@
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_enums.h"
#include "vp9/common/vp9_prob.h"
#include "vp9/common/vp9_scan.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -137,18 +137,6 @@ struct VP9Common;
void
vp9_default_coef_probs
(
struct
VP9Common
*
cm
);
void
vp9_adapt_coef_probs
(
struct
VP9Common
*
cm
);
static
INLINE
void
reset_skip_context
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE
bsize
)
{
int
i
;
for
(
i
=
0
;
i
<
MAX_MB_PLANE
;
i
++
)
{
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
i
];
const
BLOCK_SIZE
plane_bsize
=
get_plane_block_size
(
bsize
,
pd
);
memset
(
pd
->
above_context
,
0
,
sizeof
(
ENTROPY_CONTEXT
)
*
num_4x4_blocks_wide_lookup
[
plane_bsize
]);
memset
(
pd
->
left_context
,
0
,
sizeof
(
ENTROPY_CONTEXT
)
*
num_4x4_blocks_high_lookup
[
plane_bsize
]);
}
}
// This is the index in the scan order beyond which all coefficients for
// 8x8 transform and above are in the top band.
// This macro is currently unused but may be used by certain implementations
...
...
@@ -185,6 +173,13 @@ typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
void
vp9_model_to_full_probs
(
const
vp9_prob
*
model
,
vp9_prob
*
full
);
typedef
char
ENTROPY_CONTEXT
;
static
INLINE
int
combine_entropy_contexts
(
ENTROPY_CONTEXT
a
,
ENTROPY_CONTEXT
b
)
{
return
(
a
!=
0
)
+
(
b
!=
0
);
}
static
INLINE
int
get_entropy_context
(
TX_SIZE
tx_size
,
const
ENTROPY_CONTEXT
*
a
,
const
ENTROPY_CONTEXT
*
l
)
{
ENTROPY_CONTEXT
above_ec
=
0
,
left_ec
=
0
;
...
...
@@ -214,18 +209,6 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
return
combine_entropy_contexts
(
above_ec
,
left_ec
);
}
static
INLINE
const
scan_order
*
get_scan
(
const
MACROBLOCKD
*
xd
,
TX_SIZE
tx_size
,
PLANE_TYPE
type
,
int
block_idx
)
{
const
MODE_INFO
*
const
mi
=
xd
->
mi
[
0
];
if
(
is_inter_block
(
&
mi
->
mbmi
)
||
type
!=
PLANE_TYPE_Y
||
xd
->
lossless
)
{
return
&
vp9_default_scan_orders
[
tx_size
];
}
else
{
const
PREDICTION_MODE
mode
=
get_y_mode
(
mi
,
block_idx
);
return
&
vp9_scan_orders
[
tx_size
][
intra_mode_to_tx_type_lookup
[
mode
]];
}
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/common/vp9_entropymode.h
View file @
bbea7c95
...
...
@@ -11,7 +11,7 @@
#ifndef VP9_COMMON_VP9_ENTROPYMODE_H_
#define VP9_COMMON_VP9_ENTROPYMODE_H_
#include "vp9/common/vp9_
blockd
.h"
#include "vp9/common/vp9_
filter
.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymv.h"
...
...
@@ -19,8 +19,12 @@
extern
"C"
{
#endif
#define BLOCK_SIZE_GROUPS 4
#define TX_SIZE_CONTEXTS 2
#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
struct
VP9Common
;
struct
tx_probs
{
...
...
@@ -97,15 +101,6 @@ void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p,
void
tx_counts_to_branch_counts_8x8
(
const
unsigned
int
*
tx_count_8x8p
,
unsigned
int
(
*
ct_8x8p
)[
2
]);
static
INLINE
const
vp9_prob
*
get_y_mode_probs
(
const
MODE_INFO
*
mi
,
const
MODE_INFO
*
above_mi
,
const
MODE_INFO
*
left_mi
,
int
block
)
{
const
PREDICTION_MODE
above
=
vp9_above_block_mode
(
mi
,
above_mi
,
block
);
const
PREDICTION_MODE
left
=
vp9_left_block_mode
(
mi
,
left_mi
,
block
);
return
vp9_kf_y_mode_prob
[
above
][
left
];
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/common/vp9_enums.h
View file @
bbea7c95
...
...
@@ -104,6 +104,44 @@ typedef enum {
VP9_ALT_FLAG
=
1
<<
2
,
}
VP9_REFFRAME
;
typedef
enum
{
PLANE_TYPE_Y
=
0
,
PLANE_TYPE_UV
=
1
,
PLANE_TYPES
}
PLANE_TYPE
;
typedef
enum
{
DC_PRED
,
// Average of above and left pixels
V_PRED
,
// Vertical
H_PRED
,
// Horizontal
D45_PRED
,
// Directional 45 deg = round(arctan(1/1) * 180/pi)
D135_PRED
,
// Directional 135 deg = 180 - 45
D117_PRED
,
// Directional 117 deg = 180 - 63
D153_PRED
,
// Directional 153 deg = 180 - 27
D207_PRED
,
// Directional 207 deg = 180 + 27
D63_PRED
,
// Directional 63 deg = round(arctan(2/1) * 180/pi)
TM_PRED
,
// True-motion
NEARESTMV
,
NEARMV
,
ZEROMV
,
NEWMV
,
MB_MODE_COUNT
}
PREDICTION_MODE
;
#define INTRA_MODES (TM_PRED + 1)
#define INTER_MODES (1 + NEWMV - NEARESTMV)
#define SKIP_CONTEXTS 3
#define INTER_MODE_CONTEXTS 7
/* Segment Feature Masks */
#define MAX_MV_REF_CANDIDATES 2
#define INTRA_INTER_CONTEXTS 4
#define COMP_INTER_CONTEXTS 5
#define REF_CONTEXTS 5
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/common/vp9_scan.h
View file @
bbea7c95
...
...
@@ -38,6 +38,18 @@ static INLINE int get_coef_context(const int16_t *neighbors,
token_cache
[
neighbors
[
MAX_NEIGHBORS
*
c
+
1
]])
>>
1
;
}
static
INLINE
const
scan_order
*
get_scan
(
const
MACROBLOCKD
*
xd
,
TX_SIZE
tx_size
,
PLANE_TYPE
type
,
int
block_idx
)
{
const
MODE_INFO
*
const
mi
=
xd
->
mi
[
0
];
if
(
is_inter_block
(
&
mi
->
mbmi
)
||
type
!=
PLANE_TYPE_Y
||
xd
->
lossless
)
{
return
&
vp9_default_scan_orders
[
tx_size
];
}
else
{
const
PREDICTION_MODE
mode
=
get_y_mode
(
mi
,
block_idx
);
return
&
vp9_scan_orders
[
tx_size
][
intra_mode_to_tx_type_lookup
[
mode
]];
}
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/decoder/vp9_detokenize.c
View file @
bbea7c95
...
...
@@ -17,6 +17,7 @@
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#include "vp9/common/vp9_idct.h"
#endif
#include "vp9/common/vp9_scan.h"
#include "vp9/decoder/vp9_detokenize.h"
...
...
vp9/encoder/vp9_encodemb.c
View file @
bbea7c95
...
...
@@ -18,6 +18,7 @@
#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_scan.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/encoder/vp9_encodemb.h"
...
...
vp9/encoder/vp9_pickmode.c
View file @
bbea7c95
...
...
@@ -25,6 +25,7 @@
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_scan.h"
#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_encoder.h"
...
...
vp9/encoder/vp9_rdopt.c
View file @
bbea7c95
...
...
@@ -25,6 +25,7 @@
#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_scan.h"
#include "vp9/common/vp9_seg_common.h"
#include "vp9/common/vp9_systemdependent.h"
...
...
vp9/encoder/vp9_tokenize.c
View file @
bbea7c95
...
...
@@ -17,6 +17,7 @@
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_scan.h"
#include "vp9/common/vp9_seg_common.h"
#include "vp9/encoder/vp9_cost.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment