Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
d5e6f095
Commit
d5e6f095
authored
Feb 28, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Feb 28, 2014
Browse files
Merge "Cleaning up vp9_bitstream.{c, h} files."
parents
28bd1dd1
c63e27b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_bitstream.c
View file @
d5e6f095
...
...
@@ -16,19 +16,19 @@
#include
"vpx_mem/vpx_mem.h"
#include
"vpx_ports/mem_ops.h"
#include
"vp9/common/vp9_entropy.h"
#include
"vp9/common/vp9_entropymode.h"
#include
"vp9/common/vp9_entropymv.h"
#include
"vp9/common/vp9_tile_common.h"
#include
"vp9/common/vp9_seg_common.h"
#include
"vp9/common/vp9_pred_common.h"
#include
"vp9/common/vp9_entropy.h"
#include
"vp9/common/vp9_mvref_common.h"
#include
"vp9/common/vp9_systemdependent.h"
#include
"vp9/common/vp9_pragmas.h"
#include
"vp9/common/vp9_pred_common.h"
#include
"vp9/common/vp9_seg_common.h"
#include
"vp9/common/vp9_systemdependent.h"
#include
"vp9/common/vp9_tile_common.h"
#include
"vp9/encoder/vp9_mcomp.h"
#include
"vp9/encoder/vp9_encodemv.h"
#include
"vp9/encoder/vp9_bitstream.h"
#include
"vp9/encoder/vp9_encodemv.h"
#include
"vp9/encoder/vp9_mcomp.h"
#include
"vp9/encoder/vp9_segmentation.h"
#include
"vp9/encoder/vp9_subexp.h"
#include
"vp9/encoder/vp9_tokenize.h"
...
...
@@ -62,8 +62,8 @@ static void write_inter_mode(vp9_writer *w, MB_PREDICTION_MODE mode,
&
inter_mode_encodings
[
INTER_OFFSET
(
mode
)]);
}
void
vp9_
encode_unsigned_max
(
struct
vp9_write_bit_buffer
*
wb
,
int
data
,
int
max
)
{
static
void
encode_unsigned_max
(
struct
vp9_write_bit_buffer
*
wb
,
int
data
,
int
max
)
{
vp9_wb_write_literal
(
wb
,
data
,
get_unsigned_bits
(
max
));
}
...
...
@@ -109,15 +109,14 @@ static int write_skip(const VP9_COMP *cpi, int segment_id, MODE_INFO *m,
}
}
void
vp9_
update_skip_probs
(
VP9_COMMON
*
cm
,
vp9_writer
*
w
)
{
static
void
update_skip_probs
(
VP9_COMMON
*
cm
,
vp9_writer
*
w
)
{
int
k
;
for
(
k
=
0
;
k
<
SKIP_CONTEXTS
;
++
k
)
vp9_cond_prob_diff_update
(
w
,
&
cm
->
fc
.
skip_probs
[
k
],
cm
->
counts
.
skip
[
k
]);
}
static
void
update_switchable_interp_probs
(
VP9_COMP
*
cpi
,
vp9_writer
*
w
)
{
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
static
void
update_switchable_interp_probs
(
VP9_COMMON
*
cm
,
vp9_writer
*
w
)
{
int
j
;
for
(
j
=
0
;
j
<
SWITCHABLE_FILTER_CONTEXTS
;
++
j
)
prob_diff_update
(
vp9_switchable_interp_tree
,
...
...
@@ -125,9 +124,8 @@ static void update_switchable_interp_probs(VP9_COMP *cpi, vp9_writer *w) {
cm
->
counts
.
switchable_interp
[
j
],
SWITCHABLE_FILTERS
,
w
);
}
static
void
pack_mb_tokens
(
vp9_writer
*
const
w
,
TOKENEXTRA
**
tp
,
const
TOKENEXTRA
*
const
stop
)
{
static
void
pack_mb_tokens
(
vp9_writer
*
w
,
TOKENEXTRA
**
tp
,
const
TOKENEXTRA
*
stop
)
{
TOKENEXTRA
*
p
=
*
tp
;
while
(
p
<
stop
&&
p
->
token
!=
EOSB_TOKEN
)
{
...
...
@@ -236,7 +234,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
MACROBLOCK
*
const
x
=
&
cpi
->
mb
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
const
struct
segmentation
*
const
seg
=
&
cm
->
seg
;
MB_MODE_INFO
*
const
mi
=
&
m
->
mbmi
;
const
MB_MODE_INFO
*
const
mi
=
&
m
->
mbmi
;
const
MV_REFERENCE_FRAME
ref0
=
mi
->
ref_frame
[
0
];
const
MV_REFERENCE_FRAME
ref1
=
mi
->
ref_frame
[
1
];
const
MB_PREDICTION_MODE
mode
=
mi
->
mode
;
...
...
@@ -696,7 +694,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
}
}
static
void
update_coef_probs
(
VP9_COMP
*
cpi
,
vp9_writer
*
w
)
{
static
void
update_coef_probs
(
VP9_COMP
*
cpi
,
vp9_writer
*
w
)
{
const
TX_MODE
tx_mode
=
cpi
->
common
.
tx_mode
;
const
TX_SIZE
max_tx_size
=
tx_mode_to_biggest_tx_size
[
tx_mode
];
TX_SIZE
tx_size
;
...
...
@@ -819,10 +817,10 @@ static void encode_segmentation(VP9_COMP *cpi,
const
int
data_max
=
vp9_seg_feature_data_max
(
j
);
if
(
vp9_is_segfeature_signed
(
j
))
{
vp9_
encode_unsigned_max
(
wb
,
abs
(
data
),
data_max
);
encode_unsigned_max
(
wb
,
abs
(
data
),
data_max
);
vp9_wb_write_bit
(
wb
,
data
<
0
);
}
else
{
vp9_
encode_unsigned_max
(
wb
,
data
,
data_max
);
encode_unsigned_max
(
wb
,
data
,
data_max
);
}
}
}
...
...
@@ -831,9 +829,7 @@ static void encode_segmentation(VP9_COMP *cpi,
}
static
void
encode_txfm_probs
(
VP9_COMP
*
cpi
,
vp9_writer
*
w
)
{
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
static
void
encode_txfm_probs
(
VP9_COMMON
*
cm
,
vp9_writer
*
w
)
{
// Mode
vp9_write_literal
(
w
,
MIN
(
cm
->
tx_mode
,
ALLOW_32X32
),
2
);
if
(
cm
->
tx_mode
>=
ALLOW_32X32
)
...
...
@@ -1151,7 +1147,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
if
(
xd
->
lossless
)
cm
->
tx_mode
=
ONLY_4X4
;
else
encode_txfm_probs
(
c
pi
,
&
header_bc
);
encode_txfm_probs
(
c
m
,
&
header_bc
);
update_coef_probs
(
cpi
,
&
header_bc
);
...
...
@@ -1159,7 +1155,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
active_section
=
2
;
#endif
vp9_
update_skip_probs
(
cm
,
&
header_bc
);
update_skip_probs
(
cm
,
&
header_bc
);
if
(
!
frame_is_intra_only
(
cm
))
{
int
i
;
...
...
@@ -1174,7 +1170,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
vp9_zero
(
cm
->
counts
.
inter_mode
);
if
(
cm
->
interp_filter
==
SWITCHABLE
)
update_switchable_interp_probs
(
c
pi
,
&
header_bc
);
update_switchable_interp_probs
(
c
m
,
&
header_bc
);
for
(
i
=
0
;
i
<
INTRA_INTER_CONTEXTS
;
i
++
)
vp9_cond_prob_diff_update
(
&
header_bc
,
&
fc
->
intra_inter_prob
[
i
],
...
...
vp9/encoder/vp9_bitstream.h
View file @
d5e6f095
...
...
@@ -16,7 +16,11 @@
extern
"C"
{
#endif
void
vp9_update_skip_probs
(
VP9_COMMON
*
cm
,
vp9_writer
*
bc
);
struct
VP9_COMP
;
void
vp9_entropy_mode_init
();
void
vp9_pack_bitstream
(
struct
VP9_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
);
#ifdef __cplusplus
}
// extern "C"
...
...
vp9/encoder/vp9_onyx_if.c
View file @
d5e6f095
...
...
@@ -27,6 +27,7 @@
#include
"vp9/common/vp9_systemdependent.h"
#include
"vp9/common/vp9_tile_common.h"
#include
"vp9/encoder/vp9_bitstream.h"
#include
"vp9/encoder/vp9_encodemv.h"
#include
"vp9/encoder/vp9_firstpass.h"
#include
"vp9/encoder/vp9_mbgraph.h"
...
...
@@ -39,7 +40,6 @@
#include
"vp9/encoder/vp9_vaq.h"
#include
"vp9/encoder/vp9_resize.h"
void
vp9_entropy_mode_init
();
void
vp9_coef_tree_initialize
();
#define DEFAULT_INTERP_FILTER SWITCHABLE
...
...
vp9/encoder/vp9_onyx_int.h
View file @
d5e6f095
...
...
@@ -714,8 +714,6 @@ static YV12_BUFFER_CONFIG *get_ref_frame_buffer(VP9_COMP *cpi,
void
vp9_encode_frame
(
VP9_COMP
*
cpi
);
void
vp9_pack_bitstream
(
VP9_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
);
void
vp9_set_speed_features
(
VP9_COMP
*
cpi
);
int
vp9_calc_ss_err
(
const
YV12_BUFFER_CONFIG
*
source
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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