summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_common.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-21 23:11:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-21 23:11:27 +0100
commitb5a69e79c579e6e15e2019ffd34ef0e09aeab586 (patch)
treebc6b0aa0776ca51a9b8a4800a7f464866221821f /libavcodec/mpegvideo_common.h
parent9e53f62be1a171eaf9620958c225d42cf5142a30 (diff)
parentad7beb2cac1563e87171a4d044a6d526527d81d9 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtpdec: Use our own SSRC in the SDES field when sending RRs Finalize changelog for 0.8 Release Prepare for 0.8 Release threads: change the default for threads back to 1 threads: update slice_count and slice_offset from user context aviocat: Remove useless includes doc/APIChanges: fill in missing dates and hashes Revert "avserver: fix build after the next bump." mpegaudiodec: switch error detection check to AV_EF_BUFFER lavf: rename fer option and document resulting (f_)err_detect options lavc: rename err_filter option to err_detect and document it mpegvideo: fix invalid memory access for small video dimensions movenc: Reorder entries in the MOVIentry struct, for tigheter packing rtsp: Remove extern declarations for variables that don't exist aviocat: Flush the output before closing Conflicts: Changelog RELEASE libavcodec/mpegaudiodec.c libavcodec/pthread.c libavformat/options.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_common.h')
-rw-r--r--libavcodec/mpegvideo_common.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavcodec/mpegvideo_common.h b/libavcodec/mpegvideo_common.h
index 93ce265932..2b2e34ffa9 100644
--- a/libavcodec/mpegvideo_common.h
+++ b/libavcodec/mpegvideo_common.h
@@ -81,8 +81,8 @@ static inline void gmc1_motion(MpegEncContext *s,
ptr = ref_picture[0] + (src_y * linesize) + src_x;
if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x >= s->h_edge_pos - 17
- || (unsigned)src_y >= s->v_edge_pos - 17){
+ if( (unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0)
+ || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)){
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;
}
@@ -120,8 +120,8 @@ static inline void gmc1_motion(MpegEncContext *s,
offset = (src_y * uvlinesize) + src_x;
ptr = ref_picture[1] + offset;
if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x >= (s->h_edge_pos>>1) - 9
- || (unsigned)src_y >= (s->v_edge_pos>>1) - 9){
+ if( (unsigned)src_x >= FFMAX((s->h_edge_pos>>1) - 9, 0)
+ || (unsigned)src_y >= FFMAX((s->v_edge_pos>>1) - 9, 0)){
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;
emu=1;
@@ -221,8 +221,8 @@ static inline int hpel_motion(MpegEncContext *s,
src += src_y * stride + src_x;
if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){
- if( (unsigned)src_x > h_edge_pos - (motion_x&1) - w
- || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
+ if( (unsigned)src_x > FFMAX(h_edge_pos - (motion_x&1) - w, 0)
+ || (unsigned)src_y > FFMAX(v_edge_pos - (motion_y&1) - h, 0)){
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= s->edge_emu_buffer;
@@ -307,8 +307,8 @@ if(s->quarter_sample)
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&1) - 16
- || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&1) - 16, 0)
+ || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&1) - h , 0)){
if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||
s->codec_id == CODEC_ID_MPEG1VIDEO){
av_log(s->avctx,AV_LOG_DEBUG,
@@ -510,8 +510,8 @@ static inline void qpel_motion(MpegEncContext *s,
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
- || (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){
+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 16, 0)
+ || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&3) - h , 0)){
s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
17, 17+field_based, src_x, src_y<<field_based,
s->h_edge_pos, s->v_edge_pos);
@@ -588,8 +588,8 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
offset = src_y * s->uvlinesize + src_x;
ptr = ref_picture[1] + offset;
if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
- || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){
+ if( (unsigned)src_x > FFMAX((s->h_edge_pos>>1) - (dxy &1) - 8, 0)
+ || (unsigned)src_y > FFMAX((s->v_edge_pos>>1) - (dxy>>1) - 8, 0)){
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);
@@ -760,8 +760,8 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
- || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 8, 0)
+ || (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y&3) - 8, 0)){
s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
s->linesize, 9, 9,
src_x, src_y,