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
5a21de84
Commit
5a21de84
authored
Jul 03, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing 64 / MI_SIZE with MI_BLOCK_SIZE.
Change-Id: I32276552b3ea6dc1dce8e298be114cfe1019b31c
parent
904070ca
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
37 deletions
+35
-37
vp9/common/vp9_alloccommon.c
vp9/common/vp9_alloccommon.c
+10
-9
vp9/common/vp9_enums.h
vp9/common/vp9_enums.h
+1
-0
vp9/common/vp9_loopfilter.c
vp9/common/vp9_loopfilter.c
+12
-14
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+4
-4
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.c
+3
-5
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+1
-1
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_if.c
+4
-4
No files found.
vp9/common/vp9_alloccommon.c
View file @
5a21de84
...
...
@@ -11,6 +11,7 @@
#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h"
...
...
@@ -62,9 +63,9 @@ void vp9_free_frame_buffers(VP9_COMMON *oci) {
vpx_free
(
oci
->
above_context
[
0
]);
for
(
i
=
0
;
i
<
MAX_MB_PLANE
;
i
++
)
oci
->
above_context
[
i
]
=
0
;
oci
->
mip
=
0
;
oci
->
prev_mip
=
0
;
oci
->
above_seg_context
=
0
;
oci
->
mip
=
NULL
;
oci
->
prev_mip
=
NULL
;
oci
->
above_seg_context
=
NULL
;
}
static
void
set_mb_mi
(
VP9_COMMON
*
cm
,
int
aligned_width
,
int
aligned_height
)
{
...
...
@@ -74,7 +75,7 @@ static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
cm
->
mi_cols
=
aligned_width
>>
LOG2_MI_SIZE
;
cm
->
mi_rows
=
aligned_height
>>
LOG2_MI_SIZE
;
cm
->
mode_info_stride
=
cm
->
mi_cols
+
64
/
MI
_SIZE
;
cm
->
mode_info_stride
=
cm
->
mi_cols
+
MI_BLOCK
_SIZE
;
}
static
void
setup_mi
(
VP9_COMMON
*
cm
)
{
...
...
@@ -99,6 +100,7 @@ int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) {
const
int
aligned_height
=
multiple8
(
height
);
const
int
ss_x
=
oci
->
subsampling_x
;
const
int
ss_y
=
oci
->
subsampling_y
;
int
mi_size
;
vp9_free_frame_buffers
(
oci
);
...
...
@@ -131,14 +133,13 @@ int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) {
set_mb_mi
(
oci
,
aligned_width
,
aligned_height
);
// Allocation
oci
->
mip
=
vpx_calloc
(
oci
->
mode_info_stride
*
(
oci
->
mi_rows
+
64
/
MI_SIZE
),
sizeof
(
MODE_INFO
));
mi_size
=
oci
->
mode_info_stride
*
(
oci
->
mi_rows
+
MI_BLOCK_SIZE
);
oci
->
mip
=
vpx_calloc
(
mi_size
,
sizeof
(
MODE_INFO
));
if
(
!
oci
->
mip
)
goto
fail
;
oci
->
prev_mip
=
vpx_calloc
(
oci
->
mode_info_stride
*
(
oci
->
mi_rows
+
64
/
MI_SIZE
),
sizeof
(
MODE_INFO
));
oci
->
prev_mip
=
vpx_calloc
(
mi_size
,
sizeof
(
MODE_INFO
));
if
(
!
oci
->
prev_mip
)
goto
fail
;
...
...
vp9/common/vp9_enums.h
View file @
5a21de84
...
...
@@ -17,6 +17,7 @@
#define MI_SIZE (1 << LOG2_MI_SIZE)
#define MI_MASK ((64 >> LOG2_MI_SIZE) - 1)
#define MI_BLOCK_SIZE (64 / MI_SIZE)
typedef
enum
BLOCK_SIZE_TYPE
{
BLOCK_SIZE_AB4X4
,
...
...
vp9/common/vp9_loopfilter.c
View file @
5a21de84
...
...
@@ -268,23 +268,23 @@ static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
const
int
col_step
=
1
<<
xd
->
plane
[
plane
].
subsampling_x
;
struct
buf_2d
*
const
dst
=
&
xd
->
plane
[
plane
].
dst
;
uint8_t
*
const
dst0
=
dst
->
buf
;
unsigned
int
mask_16x16
[
64
/
MI
_SIZE
]
=
{
0
};
unsigned
int
mask_8x8
[
64
/
MI
_SIZE
]
=
{
0
};
unsigned
int
mask_4x4
[
64
/
MI
_SIZE
]
=
{
0
};
unsigned
int
mask_4x4_int
[
64
/
MI
_SIZE
]
=
{
0
};
struct
loop_filter_info
lfi
[
64
/
MI_SIZE
][
64
/
MI
_SIZE
];
unsigned
int
mask_16x16
[
MI_BLOCK
_SIZE
]
=
{
0
};
unsigned
int
mask_8x8
[
MI_BLOCK
_SIZE
]
=
{
0
};
unsigned
int
mask_4x4
[
MI_BLOCK
_SIZE
]
=
{
0
};
unsigned
int
mask_4x4_int
[
MI_BLOCK
_SIZE
]
=
{
0
};
struct
loop_filter_info
lfi
[
MI_BLOCK_SIZE
][
MI_BLOCK
_SIZE
];
int
r
,
c
;
MODE_INFO
*
mi
=
xd
->
mode_info_context
;
int
row_step_stride
=
cm
->
mode_info_stride
*
row_step
;
for
(
r
=
0
;
r
<
64
/
MI
_SIZE
&&
mi_row
+
r
<
cm
->
mi_rows
;
r
+=
row_step
)
{
for
(
r
=
0
;
r
<
MI_BLOCK
_SIZE
&&
mi_row
+
r
<
cm
->
mi_rows
;
r
+=
row_step
)
{
unsigned
int
mask_16x16_c
=
0
;
unsigned
int
mask_8x8_c
=
0
;
unsigned
int
mask_4x4_c
=
0
;
unsigned
int
border_mask
;
// Determine the vertical edges that need filtering
for
(
c
=
0
;
c
<
64
/
MI
_SIZE
&&
mi_col
+
c
<
cm
->
mi_cols
;
c
+=
col_step
)
{
for
(
c
=
0
;
c
<
MI_BLOCK
_SIZE
&&
mi_col
+
c
<
cm
->
mi_cols
;
c
+=
col_step
)
{
const
int
skip_this
=
mi
[
c
].
mbmi
.
mb_skip_coeff
&&
mi
[
c
].
mbmi
.
ref_frame
[
0
]
!=
INTRA_FRAME
;
// left edge of current unit is block/partition edge -> no skip
...
...
@@ -366,7 +366,7 @@ static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
// Now do horizontal pass
dst
->
buf
=
dst0
;
for
(
r
=
0
;
r
<
64
/
MI
_SIZE
&&
mi_row
+
r
<
cm
->
mi_rows
;
r
+=
row_step
)
{
for
(
r
=
0
;
r
<
MI_BLOCK
_SIZE
&&
mi_row
+
r
<
cm
->
mi_rows
;
r
+=
row_step
)
{
const
int
skip_border_4x4_r
=
ss_y
&&
mi_row
+
r
==
cm
->
mi_rows
-
1
;
const
unsigned
int
mask_4x4_int_r
=
skip_border_4x4_r
?
0
:
mask_4x4_int
[
r
];
...
...
@@ -379,19 +379,17 @@ static void filter_block_plane(VP9_COMMON *cm, MACROBLOCKD *xd,
}
}
void
vp9_loop_filter_frame
(
VP9_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
frame_filter_level
,
int
y_only
)
{
void
vp9_loop_filter_frame
(
VP9_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
frame_filter_level
,
int
y_only
)
{
int
mi_row
,
mi_col
;
// Initialize the loop filter for this frame.
vp9_loop_filter_frame_init
(
cm
,
xd
,
frame_filter_level
);
for
(
mi_row
=
0
;
mi_row
<
cm
->
mi_rows
;
mi_row
+=
64
/
MI
_SIZE
)
{
for
(
mi_row
=
0
;
mi_row
<
cm
->
mi_rows
;
mi_row
+=
MI_BLOCK
_SIZE
)
{
MODE_INFO
*
const
mi
=
cm
->
mi
+
mi_row
*
cm
->
mode_info_stride
;
for
(
mi_col
=
0
;
mi_col
<
cm
->
mi_cols
;
mi_col
+=
64
/
MI
_SIZE
)
{
for
(
mi_col
=
0
;
mi_col
<
cm
->
mi_cols
;
mi_col
+=
MI_BLOCK
_SIZE
)
{
int
plane
;
setup_dst_planes
(
xd
,
cm
->
frame_to_show
,
mi_row
,
mi_col
);
...
...
vp9/decoder/vp9_decodframe.c
View file @
5a21de84
...
...
@@ -657,13 +657,13 @@ static void decode_tile(VP9D_COMP *pbi, vp9_reader *r) {
VP9_COMMON
*
const
pc
=
&
pbi
->
common
;
int
mi_row
,
mi_col
;
for
(
mi_row
=
pc
->
cur_tile_mi_row_start
;
mi_row
<
pc
->
cur_tile_mi_row_end
;
mi_row
+=
64
/
MI
_SIZE
)
{
for
(
mi_row
=
pc
->
cur_tile_mi_row_start
;
mi_row
<
pc
->
cur_tile_mi_row_end
;
mi_row
+=
MI_BLOCK
_SIZE
)
{
// For a SB there are 2 left contexts, each pertaining to a MB row within
vpx_memset
(
&
pc
->
left_context
,
0
,
sizeof
(
pc
->
left_context
));
vpx_memset
(
pc
->
left_seg_context
,
0
,
sizeof
(
pc
->
left_seg_context
));
for
(
mi_col
=
pc
->
cur_tile_mi_col_start
;
mi_col
<
pc
->
cur_tile_mi_col_end
;
mi_col
+=
64
/
MI
_SIZE
)
for
(
mi_col
=
pc
->
cur_tile_mi_col_start
;
mi_col
<
pc
->
cur_tile_mi_col_end
;
mi_col
+=
MI_BLOCK
_SIZE
)
decode_modes_sb
(
pbi
,
mi_row
,
mi_col
,
r
,
BLOCK_SIZE_SB64X64
);
}
}
...
...
vp9/encoder/vp9_bitstream.c
View file @
5a21de84
...
...
@@ -724,14 +724,12 @@ static void write_modes(VP9_COMP *cpi, vp9_writer* const bc,
m_ptr
+=
c
->
cur_tile_mi_col_start
+
c
->
cur_tile_mi_row_start
*
mis
;
for
(
mi_row
=
c
->
cur_tile_mi_row_start
;
mi_row
<
c
->
cur_tile_mi_row_end
;
for
(
mi_row
=
c
->
cur_tile_mi_row_start
;
mi_row
<
c
->
cur_tile_mi_row_end
;
mi_row
+=
8
,
m_ptr
+=
8
*
mis
)
{
m
=
m_ptr
;
vpx_memset
(
c
->
left_seg_context
,
0
,
sizeof
(
c
->
left_seg_context
));
for
(
mi_col
=
c
->
cur_tile_mi_col_start
;
mi_col
<
c
->
cur_tile_mi_col_end
;
mi_col
+=
64
/
MI_SIZE
,
m
+=
64
/
MI_SIZE
)
for
(
mi_col
=
c
->
cur_tile_mi_col_start
;
mi_col
<
c
->
cur_tile_mi_col_end
;
mi_col
+=
MI_BLOCK_SIZE
,
m
+=
MI_BLOCK_SIZE
)
write_modes_sb
(
cpi
,
m
,
bc
,
tok
,
tok_end
,
mi_row
,
mi_col
,
BLOCK_SIZE_SB64X64
);
}
...
...
vp9/encoder/vp9_encodeframe.c
View file @
5a21de84
...
...
@@ -1583,7 +1583,7 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp,
// Code each SB in the row
for
(
mi_col
=
cm
->
cur_tile_mi_col_start
;
mi_col
<
cm
->
cur_tile_mi_col_end
;
mi_col
+=
64
/
MI
_SIZE
)
{
mi_col
+=
MI_BLOCK
_SIZE
)
{
int
dummy_rate
;
int64_t
dummy_dist
;
if
(
cpi
->
sf
.
partition_by_variance
||
cpi
->
sf
.
use_lastframe_partitioning
||
...
...
vp9/encoder/vp9_onyx_if.c
View file @
5a21de84
...
...
@@ -853,8 +853,8 @@ static void alloc_raw_frame_buffers(VP9_COMP *cpi) {
static
int
alloc_partition_data
(
VP9_COMP
*
cpi
)
{
vpx_free
(
cpi
->
mb
.
pip
);
cpi
->
mb
.
pip
=
vpx_calloc
(
(
cpi
->
common
.
mode_info_stride
)
*
(
cpi
->
common
.
mi_rows
+
64
/
MI
_SIZE
),
cpi
->
mb
.
pip
=
vpx_calloc
(
cpi
->
common
.
mode_info_stride
*
(
cpi
->
common
.
mi_rows
+
MI_BLOCK
_SIZE
),
sizeof
(
PARTITION_INFO
));
if
(
!
cpi
->
mb
.
pip
)
return
1
;
...
...
@@ -3432,11 +3432,11 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if
(
cm
->
show_frame
)
{
vpx_memcpy
(
cm
->
prev_mip
,
cm
->
mip
,
cm
->
mode_info_stride
*
(
cm
->
mi_rows
+
64
/
MI
_SIZE
)
*
cm
->
mode_info_stride
*
(
cm
->
mi_rows
+
MI_BLOCK
_SIZE
)
*
sizeof
(
MODE_INFO
));
}
else
{
vpx_memset
(
cm
->
prev_mip
,
0
,
cm
->
mode_info_stride
*
(
cm
->
mi_rows
+
64
/
MI
_SIZE
)
*
cm
->
mode_info_stride
*
(
cm
->
mi_rows
+
MI_BLOCK
_SIZE
)
*
sizeof
(
MODE_INFO
));
}
// restore prev_mi
...
...
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