Skip to content
GitLab
Menu
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
b47153de
Commit
b47153de
authored
Aug 02, 2013
by
Dmitry Kovalev
Browse files
Replacing long block size enum values with shorter ones.
Change-Id: I0e9329490828684a4fd46f540d89114cc68e8407
parent
0d680804
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_blockd.h
View file @
b47153de
...
...
@@ -283,22 +283,22 @@ typedef struct macroblockd {
static
INLINE
unsigned
char
*
get_sb_index
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE_TYPE
subsize
)
{
switch
(
subsize
)
{
case
BLOCK_
SIZE_SB
64X64
:
case
BLOCK_
SIZE_SB
64X32
:
case
BLOCK_
SIZE_SB
32X64
:
case
BLOCK_
SIZE_SB
32X32
:
case
BLOCK_64X64
:
case
BLOCK_64X32
:
case
BLOCK_32X64
:
case
BLOCK_32X32
:
return
&
xd
->
sb_index
;
case
BLOCK_
SIZE_SB
32X16
:
case
BLOCK_
SIZE_SB
16X32
:
case
BLOCK_
SIZE_MB
16X16
:
case
BLOCK_32X16
:
case
BLOCK_16X32
:
case
BLOCK_16X16
:
return
&
xd
->
mb_index
;
case
BLOCK_
SIZE_SB
16X8
:
case
BLOCK_
SIZE_SB
8X16
:
case
BLOCK_
SIZE_SB
8X8
:
case
BLOCK_16X8
:
case
BLOCK_8X16
:
case
BLOCK_8X8
:
return
&
xd
->
b_index
;
case
BLOCK_
SIZE_SB
8X4
:
case
BLOCK_
SIZE_SB
4X8
:
case
BLOCK_
SIZE_AB
4X4
:
case
BLOCK_8X4
:
case
BLOCK_4X8
:
case
BLOCK_4X4
:
return
&
xd
->
ab_index
;
default:
assert
(
0
);
...
...
vp9/common/vp9_common_data.c
View file @
b47153de
...
...
@@ -76,29 +76,29 @@ const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES]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BLOCK_SIZE_SB8X16
},
{
BLOCK_SIZE_SB16X8
,
BLOCK_SIZE_SB16X8
,
BLOCK_SIZE_MB16X16
,
BLOCK_SIZE_SB16X32
,
BLOCK_SIZE_SB16X32
},
{
BLOCK_SIZE_SB32X16
,
BLOCK_SIZE_SB32X16
,
BLOCK_SIZE_SB32X16
,
BLOCK_SIZE_SB32X32
,
BLOCK_SIZE_SB32X64
},
{
BLOCK_SIZE_SB64X32
,
BLOCK_SIZE_SB64X32
,
BLOCK_SIZE_SB64X32
,
BLOCK_SIZE_SB64X32
,
BLOCK_SIZE_SB64X64
}
{
BLOCK_4X4
,
BLOCK_4X8
,
BLOCK_4X8
,
BLOCK_4X8
,
BLOCK_4X8
},
{
BLOCK_8X4
,
BLOCK_8X8
,
BLOCK_8X16
,
BLOCK_8X16
,
BLOCK_8X16
},
{
BLOCK_16X8
,
BLOCK_16X8
,
BLOCK_16X16
,
BLOCK_16X32
,
BLOCK_16X32
},
{
BLOCK_32X16
,
BLOCK_32X16
,
BLOCK_32X16
,
BLOCK_32X32
,
BLOCK_32X64
},
{
BLOCK_64X32
,
BLOCK_64X32
,
BLOCK_64X32
,
BLOCK_64X32
,
BLOCK_64X64
}
};
vp9/encoder/vp9_encodeframe.c
View file @
b47153de
...
...
@@ -639,31 +639,31 @@ static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x,
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
switch
(
bsize
)
{
case
BLOCK_
SIZE_SB
64X64
:
case
BLOCK_64X64
:
return
&
x
->
sb64_context
;
case
BLOCK_
SIZE_SB
64X32
:
case
BLOCK_64X32
:
return
&
x
->
sb64x32_context
[
xd
->
sb_index
];
case
BLOCK_
SIZE_SB
32X64
:
case
BLOCK_32X64
:
return
&
x
->
sb32x64_context
[
xd
->
sb_index
];
case
BLOCK_
SIZE_SB
32X32
:
case
BLOCK_32X32
:
return
&
x
->
sb32_context
[
xd
->
sb_index
];
case
BLOCK_
SIZE_SB
32X16
:
case
BLOCK_32X16
:
return
&
x
->
sb32x16_context
[
xd
->
sb_index
][
xd
->
mb_index
];
case
BLOCK_
SIZE_SB
16X32
:
case
BLOCK_16X32
:
return
&
x
->
sb16x32_context
[
xd
->
sb_index
][
xd
->
mb_index
];
case
BLOCK_
SIZE_MB
16X16
:
case
BLOCK_16X16
:
return
&
x
->
mb_context
[
xd
->
sb_index
][
xd
->
mb_index
];
case
BLOCK_
SIZE_SB
16X8
:
case
BLOCK_16X8
:
return
&
x
->
sb16x8_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
case
BLOCK_
SIZE_SB
8X16
:
case
BLOCK_8X16
:
return
&
x
->
sb8x16_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
case
BLOCK_
SIZE_SB
8X8
:
case
BLOCK_8X8
:
return
&
x
->
sb8x8_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
case
BLOCK_
SIZE_SB
8X4
:
case
BLOCK_8X4
:
return
&
x
->
sb8x4_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
case
BLOCK_
SIZE_SB
4X8
:
case
BLOCK_4X8
:
return
&
x
->
sb4x8_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
case
BLOCK_
SIZE_AB
4X4
:
case
BLOCK_4X4
:
return
&
x
->
ab4x4_context
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
default:
assert
(
0
);
...
...
@@ -675,13 +675,13 @@ static BLOCK_SIZE_TYPE *get_sb_partitioning(MACROBLOCK *x,
BLOCK_SIZE_TYPE
bsize
)
{
MACROBLOCKD
*
xd
=
&
x
->
e_mbd
;
switch
(
bsize
)
{
case
BLOCK_
SIZE_SB
64X64
:
case
BLOCK_64X64
:
return
&
x
->
sb64_partitioning
;
case
BLOCK_
SIZE_SB
32X32
:
case
BLOCK_32X32
:
return
&
x
->
sb_partitioning
[
xd
->
sb_index
];
case
BLOCK_
SIZE_MB
16X16
:
case
BLOCK_16X16
:
return
&
x
->
mb_partitioning
[
xd
->
sb_index
][
xd
->
mb_index
];
case
BLOCK_
SIZE_SB
8X8
:
case
BLOCK_8X8
:
return
&
x
->
b_partitioning
[
xd
->
sb_index
][
xd
->
mb_index
][
xd
->
b_index
];
default:
assert
(
0
);
...
...
@@ -926,28 +926,28 @@ typedef enum {
static
void
tree_to_node
(
void
*
data
,
BLOCK_SIZE_TYPE
block_size
,
vt_node
*
node
)
{
int
i
;
switch
(
block_size
)
{
case
BLOCK_
SIZE_SB
64X64
:
{
case
BLOCK_64X64
:
{
v64x64
*
vt
=
(
v64x64
*
)
data
;
node
->
vt
=
&
vt
->
vt
;
for
(
i
=
0
;
i
<
4
;
i
++
)
node
->
split
[
i
]
=
&
vt
->
split
[
i
].
vt
.
none
;
break
;
}
case
BLOCK_
SIZE_SB
32X32
:
{
case
BLOCK_32X32
:
{
v32x32
*
vt
=
(
v32x32
*
)
data
;
node
->
vt
=
&
vt
->
vt
;
for
(
i
=
0
;
i
<
4
;
i
++
)
node
->
split
[
i
]
=
&
vt
->
split
[
i
].
vt
.
none
;
break
;
}
case
BLOCK_
SIZE_MB
16X16
:
{
case
BLOCK_16X16
:
{
v16x16
*
vt
=
(
v16x16
*
)
data
;
node
->
vt
=
&
vt
->
vt
;
for
(
i
=
0
;
i
<
4
;
i
++
)
node
->
split
[
i
]
=
&
vt
->
split
[
i
].
vt
.
none
;
break
;
}
case
BLOCK_
SIZE_SB
8X8
:
{
case
BLOCK_8X8
:
{
v8x8
*
vt
=
(
v8x8
*
)
data
;
node
->
vt
=
&
vt
->
vt
;
for
(
i
=
0
;
i
<
4
;
i
++
)
...
...
@@ -1585,14 +1585,14 @@ static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row,
int
use_8x8
=
1
;
if
(
cm
->
frame_type
&&
!
cpi
->
is_src_frame_alt_ref
&&
((
use_8x8
&&
bsize
==
BLOCK_
SIZE_MB
16X16
)
||
bsize
==
BLOCK_
SIZE_SB
32X32
||
bsize
==
BLOCK_
SIZE_SB
64X64
))
{
((
use_8x8
&&
bsize
==
BLOCK_16X16
)
||
bsize
==
BLOCK_32X32
||
bsize
==
BLOCK_64X64
))
{
int
ref0
=
0
,
ref1
=
0
,
ref2
=
0
,
ref3
=
0
;
PICK_MODE_CONTEXT
*
block_context
=
NULL
;
if
(
bsize
==
BLOCK_
SIZE_MB
16X16
)
{
if
(
bsize
==
BLOCK_16X16
)
{
block_context
=
x
->
sb8x8_context
[
xd
->
sb_index
][
xd
->
mb_index
];
}
else
if
(
bsize
==
BLOCK_
SIZE_SB
32X32
)
{
}
else
if
(
bsize
==
BLOCK_32X32
)
{
block_context
=
x
->
mb_context
[
xd
->
sb_index
];
}
else
if
(
bsize
==
BLOCK_SIZE_SB64X64
)
{
block_context
=
x
->
sb32_context
;
...
...
vp9/encoder/vp9_segmentation.c
View file @
b47153de
...
...
@@ -188,13 +188,13 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO *mi,
int
n
;
assert
(
bwl
<
bsl
&&
bhl
<
bsl
);
if
(
bsize
==
BLOCK_
SIZE_SB
64X64
)
{
subsize
=
BLOCK_
SIZE_SB
32X32
;
}
else
if
(
bsize
==
BLOCK_
SIZE_SB
32X32
)
{
subsize
=
BLOCK_
SIZE_MB
16X16
;
if
(
bsize
==
BLOCK_64X64
)
{
subsize
=
BLOCK_32X32
;
}
else
if
(
bsize
==
BLOCK_32X32
)
{
subsize
=
BLOCK_16X16
;
}
else
{
assert
(
bsize
==
BLOCK_
SIZE_MB
16X16
);
subsize
=
BLOCK_
SIZE_SB
8X8
;
assert
(
bsize
==
BLOCK_16X16
);
subsize
=
BLOCK_8X8
;
}
for
(
n
=
0
;
n
<
4
;
n
++
)
{
...
...
Write
Preview
Supports
Markdown
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