Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
127932e6
Commit
127932e6
authored
May 31, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
May 31, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Adding new encode_txfm function." into experimental
parents
0048ec23
75cf80ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
40 deletions
+47
-40
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.c
+46
-40
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+1
-0
No files found.
vp9/encoder/vp9_bitstream.c
View file @
127932e6
...
...
@@ -1356,6 +1356,49 @@ static void encode_segmentation(VP9_COMP *cpi, vp9_writer *w) {
}
}
static
void
encode_txfm
(
VP9_COMP
*
cpi
,
vp9_writer
*
w
)
{
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
// Mode
vp9_write_literal
(
w
,
MIN
(
cm
->
txfm_mode
,
ALLOW_32X32
),
2
);
if
(
cm
->
txfm_mode
>=
ALLOW_32X32
)
vp9_write_bit
(
w
,
cm
->
txfm_mode
==
TX_MODE_SELECT
);
// Probabilities
if
(
cm
->
txfm_mode
==
TX_MODE_SELECT
)
{
cm
->
prob_tx
[
0
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_4X4
]
+
cpi
->
txfm_count_16x16p
[
TX_4X4
]
+
cpi
->
txfm_count_8x8p
[
TX_4X4
],
cpi
->
txfm_count_32x32p
[
TX_4X4
]
+
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]
+
cpi
->
txfm_count_16x16p
[
TX_4X4
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_16X16
]
+
cpi
->
txfm_count_8x8p
[
TX_4X4
]
+
cpi
->
txfm_count_8x8p
[
TX_8X8
]);
cm
->
prob_tx
[
1
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
],
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_16X16
]);
cm
->
prob_tx
[
2
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_16X16
],
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]);
vp9_write_prob
(
w
,
cm
->
prob_tx
[
0
]);
vp9_write_prob
(
w
,
cm
->
prob_tx
[
1
]);
vp9_write_prob
(
w
,
cm
->
prob_tx
[
2
]);
}
else
{
cm
->
prob_tx
[
0
]
=
128
;
cm
->
prob_tx
[
1
]
=
128
;
cm
->
prob_tx
[
2
]
=
128
;
}
}
void
write_uncompressed_header
(
VP9_COMMON
*
cm
,
struct
vp9_write_bit_buffer
*
wb
)
{
const
int
scaling_active
=
cm
->
width
!=
cm
->
display_width
||
...
...
@@ -1521,47 +1564,10 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
}
}
if
(
cpi
->
mb
.
e_mbd
.
lossless
)
{
if
(
xd
->
lossless
)
pc
->
txfm_mode
=
ONLY_4X4
;
}
else
{
if
(
pc
->
txfm_mode
==
TX_MODE_SELECT
)
{
pc
->
prob_tx
[
0
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_4X4
]
+
cpi
->
txfm_count_16x16p
[
TX_4X4
]
+
cpi
->
txfm_count_8x8p
[
TX_4X4
],
cpi
->
txfm_count_32x32p
[
TX_4X4
]
+
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]
+
cpi
->
txfm_count_16x16p
[
TX_4X4
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_16X16
]
+
cpi
->
txfm_count_8x8p
[
TX_4X4
]
+
cpi
->
txfm_count_8x8p
[
TX_8X8
]);
pc
->
prob_tx
[
1
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
],
cpi
->
txfm_count_32x32p
[
TX_8X8
]
+
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]
+
cpi
->
txfm_count_16x16p
[
TX_8X8
]
+
cpi
->
txfm_count_16x16p
[
TX_16X16
]);
pc
->
prob_tx
[
2
]
=
get_prob
(
cpi
->
txfm_count_32x32p
[
TX_16X16
],
cpi
->
txfm_count_32x32p
[
TX_16X16
]
+
cpi
->
txfm_count_32x32p
[
TX_32X32
]);
}
else
{
pc
->
prob_tx
[
0
]
=
128
;
pc
->
prob_tx
[
1
]
=
128
;
pc
->
prob_tx
[
2
]
=
128
;
}
vp9_write_literal
(
&
header_bc
,
pc
->
txfm_mode
<=
3
?
pc
->
txfm_mode
:
3
,
2
);
if
(
pc
->
txfm_mode
>
ALLOW_16X16
)
{
vp9_write_bit
(
&
header_bc
,
pc
->
txfm_mode
==
TX_MODE_SELECT
);
}
if
(
pc
->
txfm_mode
==
TX_MODE_SELECT
)
{
vp9_write_prob
(
&
header_bc
,
pc
->
prob_tx
[
0
]);
vp9_write_prob
(
&
header_bc
,
pc
->
prob_tx
[
1
]);
vp9_write_prob
(
&
header_bc
,
pc
->
prob_tx
[
2
]);
}
}
else
encode_txfm
(
cpi
,
&
header_bc
);
// If appropriate update the inter mode probability context and code the
// changes in the bitstream.
...
...
vp9/encoder/vp9_encodeframe.c
View file @
127932e6
...
...
@@ -1835,6 +1835,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
if
(
txfm_type
!=
TX_MODE_SELECT
)
{
cpi
->
common
.
prob_tx
[
0
]
=
128
;
cpi
->
common
.
prob_tx
[
1
]
=
128
;
cpi
->
common
.
prob_tx
[
2
]
=
128
;
}
cpi
->
common
.
comp_pred_mode
=
pred_type
;
encode_frame_internal
(
cpi
);
...
...
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