Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
x264
Commits
af0d8d85
Commit
af0d8d85
authored
Aug 10, 2011
by
Henrik Gramner
Committed by
Fiona Glaser
Aug 24, 2011
Browse files
Expand borders before chroma weightp analysis
Prevents mc from using uninitialized source pixels.
parent
cfcce49d
Changes
3
Hide whitespace changes
Inline
Side-by-side
common/frame.c
View file @
af0d8d85
...
...
@@ -542,6 +542,13 @@ void x264_frame_expand_border_lowres( x264_frame_t *frame )
plane_expand_border
(
frame
->
lowres
[
i
],
frame
->
i_stride_lowres
,
frame
->
i_width_lowres
,
frame
->
i_lines_lowres
,
PADH
,
PADV
,
1
,
1
,
0
);
}
void
x264_frame_expand_border_chroma
(
x264_t
*
h
,
x264_frame_t
*
frame
,
int
plane
)
{
int
shift
=
!
CHROMA444
;
plane_expand_border
(
frame
->
plane
[
plane
],
frame
->
i_stride
[
plane
],
16
*
h
->
mb
.
i_mb_width
,
16
*
h
->
mb
.
i_mb_height
>>
shift
,
PADH
,
PADV
>>
shift
,
1
,
1
,
shift
);
}
void
x264_frame_expand_border_mod16
(
x264_t
*
h
,
x264_frame_t
*
frame
)
{
for
(
int
i
=
0
;
i
<
frame
->
i_plane
;
i
++
)
...
...
common/frame.h
View file @
af0d8d85
...
...
@@ -198,6 +198,7 @@ int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_pictur
void
x264_frame_expand_border
(
x264_t
*
h
,
x264_frame_t
*
frame
,
int
mb_y
,
int
b_end
);
void
x264_frame_expand_border_filtered
(
x264_t
*
h
,
x264_frame_t
*
frame
,
int
mb_y
,
int
b_end
);
void
x264_frame_expand_border_lowres
(
x264_frame_t
*
frame
);
void
x264_frame_expand_border_chroma
(
x264_t
*
h
,
x264_frame_t
*
frame
,
int
plane
);
void
x264_frame_expand_border_mod16
(
x264_t
*
h
,
x264_frame_t
*
frame
);
void
x264_expand_border_mbpair
(
x264_t
*
h
,
int
mb_x
,
int
mb_y
);
...
...
encoder/slicetype.c
View file @
af0d8d85
...
...
@@ -115,6 +115,7 @@ static NOINLINE void x264_weight_cost_init_chroma( x264_t *h, x264_frame_t *fenc
if
(
fenc
->
lowres_mvs
[
0
][
ref0_distance
][
0
][
0
]
!=
0x7FFF
)
{
x264_frame_expand_border_chroma
(
h
,
ref
,
1
);
for
(
int
y
=
0
,
mb_xy
=
0
,
pel_offset_y
=
0
;
y
<
i_lines
;
y
+=
8
,
pel_offset_y
=
y
*
i_stride
)
for
(
int
x
=
0
,
pel_offset_x
=
0
;
x
<
i_width
;
x
+=
8
,
mb_xy
++
,
pel_offset_x
+=
8
)
{
...
...
@@ -141,6 +142,7 @@ static NOINLINE pixel *x264_weight_cost_init_chroma444( x264_t *h, x264_frame_t
if
(
fenc
->
lowres_mvs
[
0
][
ref0_distance
][
0
][
0
]
!=
0x7FFF
)
{
x264_frame_expand_border_chroma
(
h
,
ref
,
p
);
for
(
int
y
=
0
,
mb_xy
=
0
,
pel_offset_y
=
0
;
y
<
i_lines
;
y
+=
16
,
pel_offset_y
=
y
*
i_stride
)
for
(
int
x
=
0
,
pel_offset_x
=
0
;
x
<
i_width
;
x
+=
16
,
mb_xy
++
,
pel_offset_x
+=
16
)
{
...
...
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