Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2e279598
Commit
2e279598
authored
Jan 27, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ff_emulated_edge_mc() into DSPContext.
parent
e5262ec4
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
65 additions
and
49 deletions
+65
-49
cavs.c
libavcodec/cavs.c
+3
-3
dsputil.c
libavcodec/dsputil.c
+1
-0
dsputil.h
libavcodec/dsputil.h
+15
-0
h264.c
libavcodec/h264.c
+3
-3
mpegvideo.c
libavcodec/mpegvideo.c
+6
-6
mpegvideo_common.h
libavcodec/mpegvideo_common.h
+13
-13
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+3
-3
rv34.c
libavcodec/rv34.c
+3
-3
snow.c
libavcodec/snow.c
+1
-1
svq3.c
libavcodec/svq3.c
+2
-2
vc1dec.c
libavcodec/vc1dec.c
+9
-9
vp3.c
libavcodec/vp3.c
+1
-1
vp56.c
libavcodec/vp56.c
+1
-1
vp8.c
libavcodec/vp8.c
+1
-1
wmv2.c
libavcodec/wmv2.c
+3
-3
No files found.
libavcodec/cavs.c
View file @
2e279598
...
@@ -353,7 +353,7 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
...
@@ -353,7 +353,7 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
||
full_my
<
0
-
extra_height
||
full_my
<
0
-
extra_height
||
full_mx
+
16
/*FIXME*/
>
pic_width
+
extra_width
||
full_mx
+
16
/*FIXME*/
>
pic_width
+
extra_width
||
full_my
+
16
/*FIXME*/
>
pic_height
+
extra_height
){
||
full_my
+
16
/*FIXME*/
>
pic_height
+
extra_height
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_y
-
2
-
2
*
h
->
l_stride
,
h
->
l_stride
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_y
-
2
-
2
*
h
->
l_stride
,
h
->
l_stride
,
16
+
5
,
16
+
5
/*FIXME*/
,
full_mx
-
2
,
full_my
-
2
,
pic_width
,
pic_height
);
16
+
5
,
16
+
5
/*FIXME*/
,
full_mx
-
2
,
full_my
-
2
,
pic_width
,
pic_height
);
src_y
=
s
->
edge_emu_buffer
+
2
+
2
*
h
->
l_stride
;
src_y
=
s
->
edge_emu_buffer
+
2
+
2
*
h
->
l_stride
;
emu
=
1
;
emu
=
1
;
...
@@ -365,14 +365,14 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
...
@@ -365,14 +365,14 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
}
}
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cb
,
h
->
c_stride
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cb
,
h
->
c_stride
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
src_cb
=
s
->
edge_emu_buffer
;
src_cb
=
s
->
edge_emu_buffer
;
}
}
chroma_op
(
dest_cb
,
src_cb
,
h
->
c_stride
,
chroma_height
,
mx
&
7
,
my
&
7
);
chroma_op
(
dest_cb
,
src_cb
,
h
->
c_stride
,
chroma_height
,
mx
&
7
,
my
&
7
);
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cr
,
h
->
c_stride
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cr
,
h
->
c_stride
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
src_cr
=
s
->
edge_emu_buffer
;
src_cr
=
s
->
edge_emu_buffer
;
}
}
...
...
libavcodec/dsputil.c
View file @
2e279598
...
@@ -4218,6 +4218,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
...
@@ -4218,6 +4218,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c
->
add_pixels8
=
add_pixels8_c
;
c
->
add_pixels8
=
add_pixels8_c
;
c
->
add_pixels4
=
add_pixels4_c
;
c
->
add_pixels4
=
add_pixels4_c
;
c
->
sum_abs_dctelem
=
sum_abs_dctelem_c
;
c
->
sum_abs_dctelem
=
sum_abs_dctelem_c
;
c
->
emulated_edge_mc
=
ff_emulated_edge_mc
;
c
->
gmc1
=
gmc1_c
;
c
->
gmc1
=
gmc1_c
;
c
->
gmc
=
ff_gmc_c
;
c
->
gmc
=
ff_gmc_c
;
c
->
clear_block
=
clear_block_c
;
c
->
clear_block
=
clear_block_c
;
...
...
libavcodec/dsputil.h
View file @
2e279598
...
@@ -215,6 +215,21 @@ typedef struct DSPContext {
...
@@ -215,6 +215,21 @@ typedef struct DSPContext {
void
(
*
add_pixels8
)(
uint8_t
*
pixels
,
DCTELEM
*
block
,
int
line_size
);
void
(
*
add_pixels8
)(
uint8_t
*
pixels
,
DCTELEM
*
block
,
int
line_size
);
void
(
*
add_pixels4
)(
uint8_t
*
pixels
,
DCTELEM
*
block
,
int
line_size
);
void
(
*
add_pixels4
)(
uint8_t
*
pixels
,
DCTELEM
*
block
,
int
line_size
);
int
(
*
sum_abs_dctelem
)(
DCTELEM
*
block
/*align 16*/
);
int
(
*
sum_abs_dctelem
)(
DCTELEM
*
block
/*align 16*/
);
/**
* Motion estimation with emulated edge values.
* @param buf pointer to destination buffer (unaligned)
* @param src pointer to pixel source (unaligned)
* @param linesize width (in pixels) for src/buf
* @param block_w number of pixels (per row) to copy to buf
* @param block_h nummber of pixel rows to copy to buf
* @param src_x offset of src to start of row - this may be negative
* @param src_y offset of src to top of image - this may be negative
* @param w width of src in pixels
* @param h height of src in pixels
*/
void
(
*
emulated_edge_mc
)(
uint8_t
*
buf
,
const
uint8_t
*
src
,
int
linesize
,
int
block_w
,
int
block_h
,
int
src_x
,
int
src_y
,
int
w
,
int
h
);
/**
/**
* translational global motion compensation.
* translational global motion compensation.
*/
*/
...
...
libavcodec/h264.c
View file @
2e279598
...
@@ -361,7 +361,7 @@ static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square,
...
@@ -361,7 +361,7 @@ static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square,
||
full_my
<
0
-
extra_height
||
full_my
<
0
-
extra_height
||
full_mx
+
16
/*FIXME*/
>
pic_width
+
extra_width
||
full_mx
+
16
/*FIXME*/
>
pic_width
+
extra_width
||
full_my
+
16
/*FIXME*/
>
pic_height
+
extra_height
){
||
full_my
+
16
/*FIXME*/
>
pic_height
+
extra_height
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_y
-
2
-
2
*
h
->
mb_linesize
,
h
->
mb_linesize
,
16
+
5
,
16
+
5
/*FIXME*/
,
full_mx
-
2
,
full_my
-
2
,
pic_width
,
pic_height
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_y
-
2
-
2
*
h
->
mb_linesize
,
h
->
mb_linesize
,
16
+
5
,
16
+
5
/*FIXME*/
,
full_mx
-
2
,
full_my
-
2
,
pic_width
,
pic_height
);
src_y
=
s
->
edge_emu_buffer
+
2
+
2
*
h
->
mb_linesize
;
src_y
=
s
->
edge_emu_buffer
+
2
+
2
*
h
->
mb_linesize
;
emu
=
1
;
emu
=
1
;
}
}
...
@@ -382,13 +382,13 @@ static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square,
...
@@ -382,13 +382,13 @@ static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square,
src_cr
=
pic
->
data
[
2
]
+
(
mx
>>
3
)
+
(
my
>>
3
)
*
h
->
mb_uvlinesize
;
src_cr
=
pic
->
data
[
2
]
+
(
mx
>>
3
)
+
(
my
>>
3
)
*
h
->
mb_uvlinesize
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cb
,
h
->
mb_uvlinesize
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cb
,
h
->
mb_uvlinesize
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
src_cb
=
s
->
edge_emu_buffer
;
src_cb
=
s
->
edge_emu_buffer
;
}
}
chroma_op
(
dest_cb
,
src_cb
,
h
->
mb_uvlinesize
,
chroma_height
,
mx
&
7
,
my
&
7
);
chroma_op
(
dest_cb
,
src_cb
,
h
->
mb_uvlinesize
,
chroma_height
,
mx
&
7
,
my
&
7
);
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cr
,
h
->
mb_uvlinesize
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src_cr
,
h
->
mb_uvlinesize
,
9
,
9
/*FIXME*/
,
(
mx
>>
3
),
(
my
>>
3
),
pic_width
>>
1
,
pic_height
>>
1
);
src_cr
=
s
->
edge_emu_buffer
;
src_cr
=
s
->
edge_emu_buffer
;
}
}
chroma_op
(
dest_cr
,
src_cr
,
h
->
mb_uvlinesize
,
chroma_height
,
mx
&
7
,
my
&
7
);
chroma_op
(
dest_cr
,
src_cr
,
h
->
mb_uvlinesize
,
chroma_height
,
mx
&
7
,
my
&
7
);
...
...
libavcodec/mpegvideo.c
View file @
2e279598
...
@@ -1479,7 +1479,7 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
...
@@ -1479,7 +1479,7 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
w
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
w
||
(
unsigned
)
src_y
>
(
v_edge_pos
>>
field_based
)
-
(
!!
sy
)
-
h
){
||
(
unsigned
)
src_y
>
(
v_edge_pos
>>
field_based
)
-
(
!!
sy
)
-
h
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
w
+
1
,
(
h
+
1
)
<<
field_based
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
w
+
1
,
(
h
+
1
)
<<
field_based
,
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
v_edge_pos
);
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
v_edge_pos
);
src
=
s
->
edge_emu_buffer
;
src
=
s
->
edge_emu_buffer
;
emu
=
1
;
emu
=
1
;
...
@@ -1552,14 +1552,14 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
...
@@ -1552,14 +1552,14 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
2
*
block_s
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
2
*
block_s
||
(
unsigned
)
src_y
>
(
v_edge_pos
>>
field_based
)
-
(
!!
sy
)
-
h
){
||
(
unsigned
)
src_y
>
(
v_edge_pos
>>
field_based
)
-
(
!!
sy
)
-
h
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
17
,
17
+
field_based
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
17
,
17
+
field_based
,
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
v_edge_pos
);
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
v_edge_pos
);
ptr_y
=
s
->
edge_emu_buffer
;
ptr_y
=
s
->
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
ff_
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
h_edge_pos
>>
1
,
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
<<
field_based
,
h_edge_pos
>>
1
,
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
h_edge_pos
>>
1
,
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
<<
field_based
,
h_edge_pos
>>
1
,
v_edge_pos
>>
1
);
ptr_cb
=
uvbuf
;
ptr_cb
=
uvbuf
;
ptr_cr
=
uvbuf
+
16
;
ptr_cr
=
uvbuf
+
16
;
...
@@ -1625,7 +1625,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
...
@@ -1625,7 +1625,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
block_s
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
!!
sx
)
-
block_s
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
!!
sy
)
-
block_s
){
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
!!
sy
)
-
block_s
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
h_edge_pos
,
v_edge_pos
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
h_edge_pos
,
v_edge_pos
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
emu
=
1
;
emu
=
1
;
}
}
...
@@ -1636,7 +1636,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
...
@@ -1636,7 +1636,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
ptr
=
ref_picture
[
2
]
+
offset
;
ptr
=
ref_picture
[
2
]
+
offset
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
h_edge_pos
,
v_edge_pos
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
h_edge_pos
,
v_edge_pos
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
}
}
pix_op
[
op_index
](
dest_cr
,
ptr
,
s
->
uvlinesize
,
block_s
,
sx
,
sy
);
pix_op
[
op_index
](
dest_cr
,
ptr
,
s
->
uvlinesize
,
block_s
,
sx
,
sy
);
...
...
libavcodec/mpegvideo_common.h
View file @
2e279598
...
@@ -83,7 +83,7 @@ static inline void gmc1_motion(MpegEncContext *s,
...
@@ -83,7 +83,7 @@ static inline void gmc1_motion(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
(
unsigned
)
src_x
>=
s
->
h_edge_pos
-
17
if
(
(
unsigned
)
src_x
>=
s
->
h_edge_pos
-
17
||
(
unsigned
)
src_y
>=
s
->
v_edge_pos
-
17
){
||
(
unsigned
)
src_y
>=
s
->
v_edge_pos
-
17
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
linesize
,
17
,
17
,
src_x
,
src_y
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
linesize
,
17
,
17
,
src_x
,
src_y
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
}
}
}
}
...
@@ -122,7 +122,7 @@ static inline void gmc1_motion(MpegEncContext *s,
...
@@ -122,7 +122,7 @@ static inline void gmc1_motion(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
(
unsigned
)
src_x
>=
(
s
->
h_edge_pos
>>
1
)
-
9
if
(
(
unsigned
)
src_x
>=
(
s
->
h_edge_pos
>>
1
)
-
9
||
(
unsigned
)
src_y
>=
(
s
->
v_edge_pos
>>
1
)
-
9
){
||
(
unsigned
)
src_y
>=
(
s
->
v_edge_pos
>>
1
)
-
9
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
emu
=
1
;
emu
=
1
;
}
}
...
@@ -131,7 +131,7 @@ static inline void gmc1_motion(MpegEncContext *s,
...
@@ -131,7 +131,7 @@ static inline void gmc1_motion(MpegEncContext *s,
ptr
=
ref_picture
[
2
]
+
offset
;
ptr
=
ref_picture
[
2
]
+
offset
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
}
}
s
->
dsp
.
gmc1
(
dest_cr
,
ptr
,
uvlinesize
,
8
,
motion_x
&
15
,
motion_y
&
15
,
128
-
s
->
no_rounding
);
s
->
dsp
.
gmc1
(
dest_cr
,
ptr
,
uvlinesize
,
8
,
motion_x
&
15
,
motion_y
&
15
,
128
-
s
->
no_rounding
);
...
@@ -223,7 +223,7 @@ static inline int hpel_motion(MpegEncContext *s,
...
@@ -223,7 +223,7 @@ static inline int hpel_motion(MpegEncContext *s,
if
(
s
->
unrestricted_mv
&&
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
)){
if
(
s
->
unrestricted_mv
&&
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
)){
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
motion_x
&
1
)
-
w
if
(
(
unsigned
)
src_x
>
h_edge_pos
-
(
motion_x
&
1
)
-
w
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
motion_y
&
1
)
-
h
){
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
motion_y
&
1
)
-
h
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
w
+
1
,
(
h
+
1
)
<<
field_based
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
w
+
1
,
(
h
+
1
)
<<
field_based
,
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
s
->
v_edge_pos
);
src_x
,
src_y
<<
field_based
,
h_edge_pos
,
s
->
v_edge_pos
);
src
=
s
->
edge_emu_buffer
;
src
=
s
->
edge_emu_buffer
;
emu
=
1
;
emu
=
1
;
...
@@ -315,19 +315,19 @@ if(s->quarter_sample)
...
@@ -315,19 +315,19 @@ if(s->quarter_sample)
"MPEG motion vector out of boundary (%d %d)
\n
"
,
src_x
,
src_y
);
"MPEG motion vector out of boundary (%d %d)
\n
"
,
src_x
,
src_y
);
return
;
return
;
}
}
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
17
,
17
+
field_based
,
17
,
17
+
field_based
,
src_x
,
src_y
<<
field_based
,
src_x
,
src_y
<<
field_based
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr_y
=
s
->
edge_emu_buffer
;
ptr_y
=
s
->
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
ff_
emulated_edge_mc
(
uvbuf
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
ptr_cb
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
ptr_cr
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
...
@@ -512,17 +512,17 @@ static inline void qpel_motion(MpegEncContext *s,
...
@@ -512,17 +512,17 @@ static inline void qpel_motion(MpegEncContext *s,
if
(
(
unsigned
)
src_x
>
s
->
h_edge_pos
-
(
motion_x
&
3
)
-
16
if
(
(
unsigned
)
src_x
>
s
->
h_edge_pos
-
(
motion_x
&
3
)
-
16
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
motion_y
&
3
)
-
h
){
||
(
unsigned
)
src_y
>
v_edge_pos
-
(
motion_y
&
3
)
-
h
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
17
,
17
+
field_based
,
src_x
,
src_y
<<
field_based
,
17
,
17
+
field_based
,
src_x
,
src_y
<<
field_based
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr_y
=
s
->
edge_emu_buffer
;
ptr_y
=
s
->
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
18
*
s
->
linesize
;
ff_
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
uvsrc_x
,
uvsrc_y
<<
field_based
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
...
@@ -590,7 +590,7 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
...
@@ -590,7 +590,7 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
(
unsigned
)
src_x
>
(
s
->
h_edge_pos
>>
1
)
-
(
dxy
&
1
)
-
8
if
(
(
unsigned
)
src_x
>
(
s
->
h_edge_pos
>>
1
)
-
(
dxy
&
1
)
-
8
||
(
unsigned
)
src_y
>
(
s
->
v_edge_pos
>>
1
)
-
(
dxy
>>
1
)
-
8
){
||
(
unsigned
)
src_y
>
(
s
->
v_edge_pos
>>
1
)
-
(
dxy
>>
1
)
-
8
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
...
@@ -601,7 +601,7 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
...
@@ -601,7 +601,7 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
ptr
=
ref_picture
[
2
]
+
offset
;
ptr
=
ref_picture
[
2
]
+
offset
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
...
@@ -762,7 +762,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
...
@@ -762,7 +762,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
(
unsigned
)
src_x
>
s
->
h_edge_pos
-
(
motion_x
&
3
)
-
8
if
(
(
unsigned
)
src_x
>
s
->
h_edge_pos
-
(
motion_x
&
3
)
-
8
||
(
unsigned
)
src_y
>
s
->
v_edge_pos
-
(
motion_y
&
3
)
-
8
){
||
(
unsigned
)
src_y
>
s
->
v_edge_pos
-
(
motion_y
&
3
)
-
8
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
linesize
,
9
,
9
,
s
->
linesize
,
9
,
9
,
src_x
,
src_y
,
src_x
,
src_y
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
s
->
h_edge_pos
,
s
->
v_edge_pos
);
...
...
libavcodec/mpegvideo_enc.c
View file @
2e279598
...
@@ -1548,11 +1548,11 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
...
@@ -1548,11 +1548,11 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
if
(
mb_x
*
16
+
16
>
s
->
width
||
mb_y
*
16
+
16
>
s
->
height
){
if
(
mb_x
*
16
+
16
>
s
->
width
||
mb_y
*
16
+
16
>
s
->
height
){
uint8_t
*
ebuf
=
s
->
edge_emu_buffer
+
32
;
uint8_t
*
ebuf
=
s
->
edge_emu_buffer
+
32
;
ff_
emulated_edge_mc
(
ebuf
,
ptr_y
,
wrap_y
,
16
,
16
,
mb_x
*
16
,
mb_y
*
16
,
s
->
width
,
s
->
height
);
s
->
dsp
.
emulated_edge_mc
(
ebuf
,
ptr_y
,
wrap_y
,
16
,
16
,
mb_x
*
16
,
mb_y
*
16
,
s
->
width
,
s
->
height
);
ptr_y
=
ebuf
;
ptr_y
=
ebuf
;
ff_
emulated_edge_mc
(
ebuf
+
18
*
wrap_y
,
ptr_cb
,
wrap_c
,
8
,
mb_block_height
,
mb_x
*
8
,
mb_y
*
8
,
s
->
width
>>
1
,
s
->
height
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
ebuf
+
18
*
wrap_y
,
ptr_cb
,
wrap_c
,
8
,
mb_block_height
,
mb_x
*
8
,
mb_y
*
8
,
s
->
width
>>
1
,
s
->
height
>>
1
);
ptr_cb
=
ebuf
+
18
*
wrap_y
;
ptr_cb
=
ebuf
+
18
*
wrap_y
;
ff_
emulated_edge_mc
(
ebuf
+
18
*
wrap_y
+
8
,
ptr_cr
,
wrap_c
,
8
,
mb_block_height
,
mb_x
*
8
,
mb_y
*
8
,
s
->
width
>>
1
,
s
->
height
>>
1
);
s
->
dsp
.
emulated_edge_mc
(
ebuf
+
18
*
wrap_y
+
8
,
ptr_cr
,
wrap_c
,
8
,
mb_block_height
,
mb_x
*
8
,
mb_y
*
8
,
s
->
width
>>
1
,
s
->
height
>>
1
);
ptr_cr
=
ebuf
+
18
*
wrap_y
+
8
;
ptr_cr
=
ebuf
+
18
*
wrap_y
+
8
;
}
}
...
...
libavcodec/rv34.c
View file @
2e279598
...
@@ -718,12 +718,12 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
...
@@ -718,12 +718,12 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
22
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
22
*
s
->
linesize
;
srcY
-=
2
+
2
*
s
->
linesize
;
srcY
-=
2
+
2
*
s
->
linesize
;
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
(
width
<<
3
)
+
6
,
(
height
<<
3
)
+
6
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
(
width
<<
3
)
+
6
,
(
height
<<
3
)
+
6
,
src_x
-
2
,
src_y
-
2
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src_x
-
2
,
src_y
-
2
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
srcY
=
s
->
edge_emu_buffer
+
2
+
2
*
s
->
linesize
;
srcY
=
s
->
edge_emu_buffer
+
2
+
2
*
s
->
linesize
;
ff_
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
(
width
<<
2
)
+
1
,
(
height
<<
2
)
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
(
width
<<
2
)
+
1
,
(
height
<<
2
)
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
(
width
<<
2
)
+
1
,
(
height
<<
2
)
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
(
width
<<
2
)
+
1
,
(
height
<<
2
)
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
srcU
=
uvbuf
;
srcU
=
uvbuf
;
srcV
=
uvbuf
+
16
;
srcV
=
uvbuf
+
16
;
...
...
libavcodec/snow.c
View file @
2e279598
...
@@ -1171,7 +1171,7 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, i
...
@@ -1171,7 +1171,7 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, i
src
+=
sx
+
sy
*
stride
;
src
+=
sx
+
sy
*
stride
;
if
(
(
unsigned
)
sx
>=
w
-
b_w
-
(
HTAPS_MAX
-
2
)
if
(
(
unsigned
)
sx
>=
w
-
b_w
-
(
HTAPS_MAX
-
2
)
||
(
unsigned
)
sy
>=
h
-
b_h
-
(
HTAPS_MAX
-
2
)){
||
(
unsigned
)
sy
>=
h
-
b_h
-
(
HTAPS_MAX
-
2
)){
ff_
emulated_edge_mc
(
tmp
+
MB_SIZE
,
src
,
stride
,
b_w
+
HTAPS_MAX
-
1
,
b_h
+
HTAPS_MAX
-
1
,
sx
,
sy
,
w
,
h
);
s
->
dsp
.
emulated_edge_mc
(
tmp
+
MB_SIZE
,
src
,
stride
,
b_w
+
HTAPS_MAX
-
1
,
b_h
+
HTAPS_MAX
-
1
,
sx
,
sy
,
w
,
h
);
src
=
tmp
+
MB_SIZE
;
src
=
tmp
+
MB_SIZE
;
}
}
// assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
// assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
...
...
libavcodec/svq3.c
View file @
2e279598
...
@@ -283,7 +283,7 @@ static inline void svq3_mc_dir_part(MpegEncContext *s,
...
@@ -283,7 +283,7 @@ static inline void svq3_mc_dir_part(MpegEncContext *s,
src
=
pic
->
data
[
0
]
+
mx
+
my
*
s
->
linesize
;
src
=
pic
->
data
[
0
]
+
mx
+
my
*
s
->
linesize
;
if
(
emu
)
{
if
(
emu
)
{
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
(
width
+
1
),
(
height
+
1
),
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
linesize
,
(
width
+
1
),
(
height
+
1
),
mx
,
my
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
mx
,
my
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src
=
s
->
edge_emu_buffer
;
src
=
s
->
edge_emu_buffer
;
}
}
...
@@ -304,7 +304,7 @@ static inline void svq3_mc_dir_part(MpegEncContext *s,
...
@@ -304,7 +304,7 @@ static inline void svq3_mc_dir_part(MpegEncContext *s,
src
=
pic
->
data
[
i
]
+
mx
+
my
*
s
->
uvlinesize
;
src
=
pic
->
data
[
i
]
+
mx
+
my
*
s
->
uvlinesize
;
if
(
emu
)
{
if
(
emu
)
{
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
uvlinesize
,
(
width
+
1
),
(
height
+
1
),
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
,
s
->
uvlinesize
,
(
width
+
1
),
(
height
+
1
),
mx
,
my
,
(
s
->
h_edge_pos
>>
1
),
(
s
->
v_edge_pos
>>
1
));
mx
,
my
,
(
s
->
h_edge_pos
>>
1
),
(
s
->
v_edge_pos
>>
1
));
src
=
s
->
edge_emu_buffer
;
src
=
s
->
edge_emu_buffer
;
}
}
...
...
libavcodec/vc1dec.c
View file @
2e279598
...
@@ -288,12 +288,12 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
...
@@ -288,12 +288,12 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
19
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
19
*
s
->
linesize
;
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
17
+
s
->
mspel
*
2
,
17
+
s
->
mspel
*
2
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
17
+
s
->
mspel
*
2
,
17
+
s
->
mspel
*
2
,
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
srcY
=
s
->
edge_emu_buffer
;
srcY
=
s
->
edge_emu_buffer
;
ff_
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
srcU
=
uvbuf
;
srcU
=
uvbuf
;
srcV
=
uvbuf
+
16
;
srcV
=
uvbuf
+
16
;
...
@@ -403,7 +403,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n)
...
@@ -403,7 +403,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n)
||
(
unsigned
)(
src_x
-
s
->
mspel
)
>
s
->
h_edge_pos
-
(
mx
&
3
)
-
8
-
s
->
mspel
*
2
||
(
unsigned
)(
src_x
-
s
->
mspel
)
>
s
->
h_edge_pos
-
(
mx
&
3
)
-
8
-
s
->
mspel
*
2
||
(
unsigned
)(
src_y
-
s
->
mspel
)
>
s
->
v_edge_pos
-
(
my
&
3
)
-
8
-
s
->
mspel
*
2
){
||
(
unsigned
)(
src_y
-
s
->
mspel
)
>
s
->
v_edge_pos
-
(
my
&
3
)
-
8
-
s
->
mspel
*
2
){
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
9
+
s
->
mspel
*
2
,
9
+
s
->
mspel
*
2
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
9
+
s
->
mspel
*
2
,
9
+
s
->
mspel
*
2
,
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
srcY
=
s
->
edge_emu_buffer
;
srcY
=
s
->
edge_emu_buffer
;
/* if we deal with range reduction we need to scale source blocks */
/* if we deal with range reduction we need to scale source blocks */
...
@@ -537,9 +537,9 @@ static void vc1_mc_4mv_chroma(VC1Context *v)
...
@@ -537,9 +537,9 @@ static void vc1_mc_4mv_chroma(VC1Context *v)
if
(
v
->
rangeredfrm
||
(
v
->
mv_mode
==
MV_PMODE_INTENSITY_COMP
)
if
(
v
->
rangeredfrm
||
(
v
->
mv_mode
==
MV_PMODE_INTENSITY_COMP
)
||
(
unsigned
)
uvsrc_x
>
(
s
->
h_edge_pos
>>
1
)
-
9
||
(
unsigned
)
uvsrc_x
>
(
s
->
h_edge_pos
>>
1
)
-
9
||
(
unsigned
)
uvsrc_y
>
(
s
->
v_edge_pos
>>
1
)
-
9
){
||
(
unsigned
)
uvsrc_y
>
(
s
->
v_edge_pos
>>
1
)
-
9
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
srcU
=
s
->
edge_emu_buffer
;
srcU
=
s
->
edge_emu_buffer
;
srcV
=
s
->
edge_emu_buffer
+
16
;
srcV
=
s
->
edge_emu_buffer
+
16
;
...
@@ -872,12 +872,12 @@ static void vc1_interp_mc(VC1Context *v)
...
@@ -872,12 +872,12 @@ static void vc1_interp_mc(VC1Context *v)
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
19
*
s
->
linesize
;
uint8_t
*
uvbuf
=
s
->
edge_emu_buffer
+
19
*
s
->
linesize
;
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
srcY
-=
s
->
mspel
*
(
1
+
s
->
linesize
);
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
17
+
s
->
mspel
*
2
,
17
+
s
->
mspel
*
2
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
srcY
,
s
->
linesize
,
17
+
s
->
mspel
*
2
,
17
+
s
->
mspel
*
2
,
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src_x
-
s
->
mspel
,
src_y
-
s
->
mspel
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
srcY
=
s
->
edge_emu_buffer
;
srcY
=
s
->
edge_emu_buffer
;
ff_
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
,
srcU
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ff_
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
s
->
dsp
.
emulated_edge_mc
(
uvbuf
+
16
,
srcV
,
s
->
uvlinesize
,
8
+
1
,
8
+
1
,
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
uvsrc_x
,
uvsrc_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
srcU
=
uvbuf
;
srcU
=
uvbuf
;
srcV
=
uvbuf
+
16
;
srcV
=
uvbuf
+
16
;
...
...
libavcodec/vp3.c
View file @
2e279598
...
@@ -1432,7 +1432,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
...
@@ -1432,7 +1432,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
if
(
stride
<
0
)
temp
-=
9
*
stride
;
if
(
stride
<
0
)
temp
-=
9
*
stride
;
else
temp
+=
9
*
stride
;
else
temp
+=
9
*
stride
;
ff_
emulated_edge_mc
(
temp
,
motion_source
,
stride
,
9
,
9
,
src_x
,
src_y
,
plane_width
,
plane_height
);
s
->
dsp
.
emulated_edge_mc
(
temp
,
motion_source
,
stride
,
9
,
9
,
src_x
,
src_y
,
plane_width
,
plane_height
);
motion_source
=
temp
;
motion_source
=
temp
;
}
}
}
}
...
...
libavcodec/vp56.c
View file @
2e279598
...
@@ -337,7 +337,7 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
...
@@ -337,7 +337,7 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
if
(
x
<
0
||
x
+
12
>=
s
->
plane_width
[
plane
]
||
if
(
x
<
0
||
x
+
12
>=
s
->
plane_width
[
plane
]
||
y
<
0
||
y
+
12
>=
s
->
plane_height
[
plane
])
{
y
<
0
||
y
+
12
>=
s
->
plane_height
[
plane
])
{
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
+
s
->
block_offset
[
b
]
+
(
dy
-
2
)
*
stride
+
(
dx
-
2
),
src
+
s
->
block_offset
[
b
]
+
(
dy
-
2
)
*
stride
+
(
dx
-
2
),
stride
,
12
,
12
,
x
,
y
,
stride
,
12
,
12
,
x
,
y
,
s
->
plane_width
[
plane
],
s
->
plane_width
[
plane
],
...
...
libavcodec/vp8.c
View file @
2e279598
...
@@ -1234,7 +1234,7 @@ void vp8_mc(VP8Context *s, int luma,
...
@@ -1234,7 +1234,7 @@ void vp8_mc(VP8Context *s, int luma,
src
+=
y_off
*
linesize
+
x_off
;
src
+=
y_off
*
linesize
+
x_off
;
if
(
x_off
<
mx_idx
||
x_off
>=
width
-
block_w
-
idx
[
2
][
mx
]
||
if
(
x_off
<
mx_idx
||
x_off
>=
width
-
block_w
-
idx
[
2
][
mx
]
||
y_off
<
my_idx
||
y_off
>=
height
-
block_h
-
idx
[
2
][
my
])
{
y_off
<
my_idx
||
y_off
>=
height
-
block_h
-
idx
[
2
][
my
])
{
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
-
my_idx
*
linesize
-
mx_idx
,
linesize
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
src
-
my_idx
*
linesize
-
mx_idx
,
linesize
,
block_w
+
idx
[
1
][
mx
],
block_h
+
idx
[
1
][
my
],
block_w
+
idx
[
1
][
mx
],
block_h
+
idx
[
1
][
my
],
x_off
-
mx_idx
,
y_off
-
my_idx
,
width
,
height
);
x_off
-
mx_idx
,
y_off
-
my_idx
,
width
,
height
);
src
=
s
->
edge_emu_buffer
+
mx_idx
+
linesize
*
my_idx
;
src
=
s
->
edge_emu_buffer
+
mx_idx
+
linesize
*
my_idx
;
...
...
libavcodec/wmv2.c
View file @
2e279598
...
@@ -102,7 +102,7 @@ void ff_mspel_motion(MpegEncContext *s,
...
@@ -102,7 +102,7 @@ void ff_mspel_motion(MpegEncContext *s,
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
){
if
(
src_x
<
1
||
src_y
<
1
||
src_x
+
17
>=
s
->
h_edge_pos
if
(
src_x
<
1
||
src_y
<
1
||
src_x
+
17
>=
s
->
h_edge_pos
||
src_y
+
h
+
1
>=
v_edge_pos
){
||
src_y
+
h
+
1
>=
v_edge_pos
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
-
1
-
s
->
linesize
,
s
->
linesize
,
19
,
19
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
-
1
-
s
->
linesize
,
s
->
linesize
,
19
,
19
,
src_x
-
1
,
src_y
-
1
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
src_x
-
1
,
src_y
-
1
,
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr
=
s
->
edge_emu_buffer
+
1
+
s
->
linesize
;
ptr
=
s
->
edge_emu_buffer
+
1
+
s
->
linesize
;
emu
=
1
;
emu
=
1
;
...
@@ -143,7 +143,7 @@ void ff_mspel_motion(MpegEncContext *s,
...
@@ -143,7 +143,7 @@ void ff_mspel_motion(MpegEncContext *s,
offset
=
(
src_y
*
uvlinesize
)
+
src_x
;
offset
=
(
src_y
*
uvlinesize
)
+
src_x
;
ptr
=
ref_picture
[
1
]
+
offset
;
ptr
=
ref_picture
[
1
]
+
offset
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
}
}
...
@@ -151,7 +151,7 @@ void ff_mspel_motion(MpegEncContext *s,
...
@@ -151,7 +151,7 @@ void ff_mspel_motion(MpegEncContext *s,
ptr
=
ref_picture
[
2
]
+
offset
;
ptr
=
ref_picture
[
2
]
+
offset
;
if
(
emu
){
if
(
emu
){
ff_
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
s
->
dsp
.
emulated_edge_mc
(
s
->
edge_emu_buffer
,
ptr
,
s
->
uvlinesize
,
9
,
9
,
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
src_x
,
src_y
,
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr
=
s
->
edge_emu_buffer
;
ptr
=
s
->
edge_emu_buffer
;
}
}
...
...
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