|
|
@ -28,9 +28,9 @@ |
|
|
|
#ifndef AVCODEC_RECTANGLE_H |
|
|
|
#ifndef AVCODEC_RECTANGLE_H |
|
|
|
#define AVCODEC_RECTANGLE_H |
|
|
|
#define AVCODEC_RECTANGLE_H |
|
|
|
|
|
|
|
|
|
|
|
#include <assert.h> |
|
|
|
|
|
|
|
#include "config.h" |
|
|
|
#include "config.h" |
|
|
|
#include "libavutil/common.h" |
|
|
|
#include "libavutil/common.h" |
|
|
|
|
|
|
|
#include "libavutil/avassert.h" |
|
|
|
#include "dsputil.h" |
|
|
|
#include "dsputil.h" |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -41,14 +41,14 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ |
|
|
|
static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ |
|
|
|
uint8_t *p= (uint8_t*)vp; |
|
|
|
uint8_t *p= (uint8_t*)vp; |
|
|
|
assert(size==1 || size==2 || size==4); |
|
|
|
av_assert2(size==1 || size==2 || size==4); |
|
|
|
assert(w<=4); |
|
|
|
av_assert2(w<=4); |
|
|
|
|
|
|
|
|
|
|
|
w *= size; |
|
|
|
w *= size; |
|
|
|
stride *= size; |
|
|
|
stride *= size; |
|
|
|
|
|
|
|
|
|
|
|
assert((((long)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0); |
|
|
|
av_assert2((((long)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0); |
|
|
|
assert((stride&(w-1))==0); |
|
|
|
av_assert2((stride&(w-1))==0); |
|
|
|
if(w==2){ |
|
|
|
if(w==2){ |
|
|
|
const uint16_t v= size==4 ? val : val*0x0101; |
|
|
|
const uint16_t v= size==4 ? val : val*0x0101; |
|
|
|
*(uint16_t*)(p + 0*stride)= v; |
|
|
|
*(uint16_t*)(p + 0*stride)= v; |
|
|
@ -118,8 +118,8 @@ static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, |
|
|
|
*(uint32_t*)(p +12+3*stride)= val; |
|
|
|
*(uint32_t*)(p +12+3*stride)= val; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
}else |
|
|
|
}else |
|
|
|
assert(0); |
|
|
|
av_assert2(0); |
|
|
|
assert(h==4); |
|
|
|
av_assert2(h==4); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif /* AVCODEC_RECTANGLE_H */ |
|
|
|
#endif /* AVCODEC_RECTANGLE_H */ |
|
|
|