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
599395ee
Commit
599395ee
authored
Jul 21, 2017
by
Thomas Davies
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NEW_MULTISYMBOL: adapt binary MV values.
Change-Id: I00f98e0e03a44aa894566b7a47bb0f32b56da766
parent
4c5df105
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
5 deletions
+66
-5
av1/common/entropy.c
av1/common/entropy.c
+5
-0
av1/common/entropymv.c
av1/common/entropymv.c
+10
-0
av1/common/entropymv.h
av1/common/entropymv.h
+5
-0
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+7
-1
av1/decoder/decodemv.c
av1/decoder/decodemv.c
+17
-2
av1/encoder/bitstream.c
av1/encoder/bitstream.c
+3
-1
av1/encoder/encodemv.c
av1/encoder/encodemv.c
+17
-1
av1/encoder/encodemv.h
av1/encoder/encodemv.h
+2
-0
No files found.
av1/common/entropy.c
View file @
599395ee
...
...
@@ -5641,6 +5641,11 @@ void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
class_cdf
)
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
class0_fp_cdf
)
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
fp_cdf
)
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
hp_cdf
)
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
class0_hp_cdf
)
AVERAGE_TILE_CDFS
(
nmvc
[
j
].
comps
[
k
].
class0_cdf
)
#endif
}
}
}
...
...
av1/common/entropymv.c
View file @
599395ee
...
...
@@ -64,6 +64,11 @@ static const nmv_context default_nmv_context = {
0
},
// fp_cdf
160
,
// class0_hp bit
128
,
// hp
#if CONFIG_NEW_MULTISYMBOL
{
AOM_ICDF
(
160
*
128
),
AOM_ICDF
(
32768
),
0
},
{
AOM_ICDF
(
128
*
128
),
AOM_ICDF
(
32768
),
0
},
{
AOM_ICDF
(
216
*
128
),
AOM_ICDF
(
32768
),
0
},
#endif
},
{
// Horizontal component
...
...
@@ -84,6 +89,11 @@ static const nmv_context default_nmv_context = {
0
},
// fp_cdf
160
,
// class0_hp bit
128
,
// hp
#if CONFIG_NEW_MULTISYMBOL
{
AOM_ICDF
(
160
*
128
),
AOM_ICDF
(
32768
),
0
},
{
AOM_ICDF
(
128
*
128
),
AOM_ICDF
(
32768
),
0
},
{
AOM_ICDF
(
216
*
128
),
AOM_ICDF
(
32768
),
0
},
#endif
}
},
};
...
...
av1/common/entropymv.h
View file @
599395ee
...
...
@@ -93,6 +93,11 @@ typedef struct {
aom_cdf_prob
fp_cdf
[
CDF_SIZE
(
MV_FP_SIZE
)];
aom_prob
class0_hp
;
aom_prob
hp
;
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob
class0_hp_cdf
[
CDF_SIZE
(
2
)];
aom_cdf_prob
hp_cdf
[
CDF_SIZE
(
2
)];
aom_cdf_prob
class0_cdf
[
CDF_SIZE
(
CLASS0_SIZE
)];
#endif
}
nmv_component
;
typedef
struct
{
...
...
av1/decoder/decodeframe.c
View file @
599395ee
...
...
@@ -248,6 +248,7 @@ static void read_frame_reference_mode_probs(AV1_COMMON *cm, aom_reader *r) {
}
}
#if !CONFIG_NEW_MULTISYMBOL
static
void
update_mv_probs
(
aom_prob
*
p
,
int
n
,
aom_reader
*
r
)
{
int
i
;
for
(
i
=
0
;
i
<
n
;
++
i
)
av1_diff_update_prob
(
r
,
&
p
[
i
],
ACCT_STR
);
...
...
@@ -263,6 +264,7 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
}
}
}
#endif
static
void
inverse_transform_block
(
MACROBLOCKD
*
xd
,
int
plane
,
#if CONFIG_LGT
...
...
@@ -4936,9 +4938,11 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#if CONFIG_SUPERTX
MACROBLOCKD
*
const
xd
=
&
pbi
->
mb
;
#endif
FRAME_CONTEXT
*
const
fc
=
cm
->
fc
;
aom_reader
r
;
#if !CONFIG_NEW_MULTISYMBOL
FRAME_CONTEXT
*
const
fc
=
cm
->
fc
;
int
i
;
#endif
#if CONFIG_ANS && ANS_MAX_SYMBOLS
r
.
window_size
=
1
<<
cm
->
ans_window_size_log2
;
...
...
@@ -5035,8 +5039,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
av1_diff_update_prob
(
&
r
,
&
fc
->
comp_inter_mode_prob
[
i
],
ACCT_STR
);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if !CONFIG_NEW_MULTISYMBOL
for
(
i
=
0
;
i
<
NMV_CONTEXTS
;
++
i
)
read_mv_probs
(
&
fc
->
nmvc
[
i
],
cm
->
allow_high_precision_mv
,
&
r
);
#endif
#if CONFIG_SUPERTX
if
(
!
xd
->
lossless
[
0
])
read_supertx_probs
(
fc
,
&
r
);
#endif
...
...
av1/decoder/decodemv.c
View file @
599395ee
...
...
@@ -1259,14 +1259,22 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp,
#endif // CONFIG_INTRABC
int
usehp
)
{
int
mag
,
d
,
fr
,
hp
;
#if CONFIG_NEW_MULTISYMBOL
const
int
sign
=
aom_read_bit
(
r
,
ACCT_STR
);
#else
const
int
sign
=
aom_read
(
r
,
mvcomp
->
sign
,
ACCT_STR
);
#endif
const
int
mv_class
=
aom_read_symbol
(
r
,
mvcomp
->
class_cdf
,
MV_CLASSES
,
ACCT_STR
);
const
int
class0
=
mv_class
==
MV_CLASS_0
;
// Integer part
if
(
class0
)
{
#if CONFIG_NEW_MULTISYMBOL
d
=
aom_read_symbol
(
r
,
mvcomp
->
class0_cdf
,
CLASS0_SIZE
,
ACCT_STR
);
#else
d
=
aom_read
(
r
,
mvcomp
->
class0
[
0
],
ACCT_STR
);
#endif
mag
=
0
;
}
else
{
int
i
;
...
...
@@ -1284,9 +1292,16 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp,
fr
=
aom_read_symbol
(
r
,
class0
?
mvcomp
->
class0_fp_cdf
[
d
]
:
mvcomp
->
fp_cdf
,
MV_FP_SIZE
,
ACCT_STR
);
// High precision part (if hp is not used, the default value of the hp is 1)
hp
=
usehp
?
aom_read
(
r
,
class0
?
mvcomp
->
class0_hp
:
mvcomp
->
hp
,
ACCT_STR
)
// High precision part (if hp is not used, the default value of the hp is 1)
#if CONFIG_NEW_MULTISYMBOL
hp
=
usehp
?
aom_read_symbol
(
r
,
class0
?
mvcomp
->
class0_hp_cdf
:
mvcomp
->
hp_cdf
,
2
,
ACCT_STR
)
:
1
;
#else
hp
=
usehp
?
aom_read
(
r
,
class0
?
mvcomp
->
class0_hp
:
mvcomp
->
hp
,
ACCT_STR
)
:
1
;
#endif
#if CONFIG_INTRABC
}
else
{
fr
=
3
;
...
...
av1/encoder/bitstream.c
View file @
599395ee
...
...
@@ -4557,10 +4557,10 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
MACROBLOCKD
*
const
xd
=
&
cpi
->
td
.
mb
.
e_mbd
;
#endif // CONFIG_SUPERTX
FRAME_CONTEXT
*
const
fc
=
cm
->
fc
;
FRAME_COUNTS
*
counts
=
cpi
->
td
.
counts
;
aom_writer
*
header_bc
;
int
i
;
#if !CONFIG_NEW_MULTISYMBOL
FRAME_COUNTS
*
counts
=
cpi
->
td
.
counts
;
int
j
;
#endif
...
...
@@ -4712,7 +4712,9 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
counts
->
comp_inter_mode
[
i
],
probwt
);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if !CONFIG_NEW_MULTISYMBOL
av1_write_nmv_probs
(
cm
,
cm
->
allow_high_precision_mv
,
header_bc
,
counts
->
mv
);
#endif
#if CONFIG_SUPERTX
if
(
!
xd
->
lossless
[
0
])
update_supertx_probs
(
cm
,
probwt
,
header_bc
);
#endif // CONFIG_SUPERTX
...
...
av1/encoder/encodemv.c
View file @
599395ee
...
...
@@ -42,15 +42,23 @@ static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp,
assert
(
comp
!=
0
);
// Sign
// Sign
#if CONFIG_NEW_MULTISYMBOL
aom_write_bit
(
w
,
sign
);
#else
aom_write
(
w
,
sign
,
mvcomp
->
sign
);
#endif
// Class
aom_write_symbol
(
w
,
mv_class
,
mvcomp
->
class_cdf
,
MV_CLASSES
);
// Integer bits
if
(
mv_class
==
MV_CLASS_0
)
{
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol
(
w
,
d
,
mvcomp
->
class0_cdf
,
CLASS0_SIZE
);
#else
aom_write
(
w
,
d
,
mvcomp
->
class0
[
0
]);
#endif
}
else
{
int
i
;
const
int
n
=
mv_class
+
CLASS0_BITS
-
1
;
// number of bits
...
...
@@ -69,7 +77,13 @@ static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp,
// High precision bit
if
(
precision
>
MV_SUBPEL_LOW_PRECISION
)
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol
(
w
,
hp
,
mv_class
==
MV_CLASS_0
?
mvcomp
->
class0_hp_cdf
:
mvcomp
->
hp_cdf
,
2
);
#else
aom_write
(
w
,
hp
,
mv_class
==
MV_CLASS_0
?
mvcomp
->
class0_hp
:
mvcomp
->
hp
);
#endif
}
static
void
build_nmv_component_cost_table
(
int
*
mvcost
,
...
...
@@ -137,6 +151,7 @@ static void build_nmv_component_cost_table(int *mvcost,
}
}
#if !CONFIG_NEW_MULTISYMBOL
static
void
update_mv
(
aom_writer
*
w
,
const
unsigned
int
ct
[
2
],
aom_prob
*
cur_p
,
aom_prob
upd_p
)
{
(
void
)
upd_p
;
...
...
@@ -163,6 +178,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
}
}
}
#endif
void
av1_encode_mv
(
AV1_COMP
*
cpi
,
aom_writer
*
w
,
const
MV
*
mv
,
const
MV
*
ref
,
nmv_context
*
mvctx
,
int
usehp
)
{
...
...
av1/encoder/encodemv.h
View file @
599395ee
...
...
@@ -20,8 +20,10 @@ extern "C" {
void
av1_entropy_mv_init
(
void
);
#if !CONFIG_NEW_MULTISYMBOL
void
av1_write_nmv_probs
(
AV1_COMMON
*
cm
,
int
usehp
,
aom_writer
*
w
,
nmv_context_counts
*
const
counts
);
#endif
void
av1_encode_mv
(
AV1_COMP
*
cpi
,
aom_writer
*
w
,
const
MV
*
mv
,
const
MV
*
ref
,
nmv_context
*
mvctx
,
int
usehp
);
...
...
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