* qatar/master: avutil: Do not make ff_ symbols globally visible. avutil: Rename ff_set_systematic_pal2() ---> avpriv_set_systematic_pal2() build: tms470: work around glibc math.h problems configure: improve tms470 compiler usage with glibc Conflicts: libavcodec/bmpenc.c libavcodec/rawdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n1.1
@@ -0,0 +1,7 @@ | |||||
#include_next <math.h> | |||||
#undef INFINITY | |||||
#undef NAN | |||||
#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 })) | |||||
#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 })) |
@@ -2568,11 +2568,8 @@ probe_cc(){ | |||||
_type=tms470 | _type=tms470 | ||||
_ident=$($_cc -version | head -n1 | tr -s ' ') | _ident=$($_cc -version | head -n1 | tr -s ' ') | ||||
_flags='--gcc --abi=eabi -me' | _flags='--gcc --abi=eabi -me' | ||||
_cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=' | |||||
_cc_e='-ppl -fe=$@' | _cc_e='-ppl -fe=$@' | ||||
_cc_o='-fe=$@' | _cc_o='-fe=$@' | ||||
as_default="${cross_prefix}gcc" | |||||
ld_default="${cross_prefix}gcc" | |||||
_depflags='-ppa -ppd=$(@:.o=.d)' | _depflags='-ppa -ppd=$(@:.o=.d)' | ||||
_cflags_speed='-O3 -mf=5' | _cflags_speed='-O3 -mf=5' | ||||
_cflags_size='-O3 -mf=2' | _cflags_size='-O3 -mf=2' | ||||
@@ -3234,6 +3231,16 @@ fi | |||||
test -n "$libc_type" && enable $libc_type | test -n "$libc_type" && enable $libc_type | ||||
# hacks for compiler/libc/os combinations | |||||
if enabled_all tms470 glibc; then | |||||
CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" | |||||
add_cppflags -D__USER_LABEL_PREFIX__= | |||||
add_cppflags -D__builtin_memset=memset | |||||
add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED | |||||
add_cflags -pds=48 # incompatible redefinition of macro | |||||
fi | |||||
esc(){ | esc(){ | ||||
echo "$*" | sed 's/%/%25/g;s/:/%3a/g' | echo "$*" | sed 's/%/%25/g;s/:/%3a/g' | ||||
} | } | ||||
@@ -99,7 +99,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, | |||||
case AV_PIX_FMT_BGR4_BYTE: | case AV_PIX_FMT_BGR4_BYTE: | ||||
case AV_PIX_FMT_GRAY8: | case AV_PIX_FMT_GRAY8: | ||||
av_assert1(bit_count == 8); | av_assert1(bit_count == 8); | ||||
ff_set_systematic_pal2(palette256, avctx->pix_fmt); | |||||
avpriv_set_systematic_pal2(palette256, avctx->pix_fmt); | |||||
pal = palette256; | pal = palette256; | ||||
break; | break; | ||||
case AV_PIX_FMT_PAL8: | case AV_PIX_FMT_PAL8: | ||||
@@ -131,7 +131,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, | |||||
case AV_PIX_FMT_GRAY8: | case AV_PIX_FMT_GRAY8: | ||||
bpp = 8; | bpp = 8; | ||||
nplanes = 1; | nplanes = 1; | ||||
ff_set_systematic_pal2(palette256, avctx->pix_fmt); | |||||
avpriv_set_systematic_pal2(palette256, avctx->pix_fmt); | |||||
pal = palette256; | pal = palette256; | ||||
break; | break; | ||||
case AV_PIX_FMT_PAL8: | case AV_PIX_FMT_PAL8: | ||||
@@ -108,7 +108,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) | |||||
return AVERROR(EINVAL); | return AVERROR(EINVAL); | ||||
} | } | ||||
ff_set_systematic_pal2(context->palette, avctx->pix_fmt); | |||||
avpriv_set_systematic_pal2(context->palette, avctx->pix_fmt); | |||||
if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) && | if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) && | ||||
avctx->pix_fmt==AV_PIX_FMT_PAL8 && | avctx->pix_fmt==AV_PIX_FMT_PAL8 && | ||||
(!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){ | (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){ | ||||
@@ -544,7 +544,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic) | |||||
buf->linesize[i] = 0; | buf->linesize[i] = 0; | ||||
} | } | ||||
if (size[1] && !size[2]) | if (size[1] && !size[2]) | ||||
ff_set_systematic_pal2((uint32_t *)buf->data[1], s->pix_fmt); | |||||
avpriv_set_systematic_pal2((uint32_t *)buf->data[1], s->pix_fmt); | |||||
buf->width = s->width; | buf->width = s->width; | ||||
buf->height = s->height; | buf->height = s->height; | ||||
buf->pix_fmt = s->pix_fmt; | buf->pix_fmt = s->pix_fmt; | ||||
@@ -320,7 +320,7 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref) | |||||
outpicref->video->h = outlink->h; | outpicref->video->h = outlink->h; | ||||
if(scale->output_is_pal) | if(scale->output_is_pal) | ||||
ff_set_systematic_pal2((uint32_t*)outpicref->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format); | |||||
avpriv_set_systematic_pal2((uint32_t*)outpicref->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format); | |||||
av_reduce(&outpicref->video->sample_aspect_ratio.num, &outpicref->video->sample_aspect_ratio.den, | av_reduce(&outpicref->video->sample_aspect_ratio.num, &outpicref->video->sample_aspect_ratio.den, | ||||
(int64_t)picref->video->sample_aspect_ratio.num * outlink->h * link->w, | (int64_t)picref->video->sample_aspect_ratio.num * outlink->h * link->w, | ||||
@@ -146,7 +146,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei | |||||
return total_size; | return total_size; | ||||
} | } | ||||
int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt) | |||||
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt) | |||||
{ | { | ||||
int i; | int i; | ||||
@@ -214,7 +214,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4], | |||||
return ret; | return ret; | ||||
} | } | ||||
if (desc->flags & PIX_FMT_PAL || desc->flags & PIX_FMT_PSEUDOPAL) | if (desc->flags & PIX_FMT_PAL || desc->flags & PIX_FMT_PSEUDOPAL) | ||||
ff_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt); | |||||
avpriv_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt); | |||||
return ret; | return ret; | ||||
} | } | ||||
@@ -187,7 +187,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, | |||||
*/ | */ | ||||
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); | int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); | ||||
int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); | |||||
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); | |||||
/** | /** | ||||
* @} | * @} | ||||