ffmpeg: add 0.10.14. GCC2 only, does not compile on GCC4.

Already tried for GCC4:
  * -fstack-check=no
  * --enable-pic
  * --disable-pic
  * -O3, -O2
... all of which were listed as solving the problem by various Linux
distros. Will try for FFmpeg 2.2 next.
This commit is contained in:
Augustin Cavalier
2014-07-28 14:31:02 -04:00
parent 4038f2a711
commit 16ee50dad0
2 changed files with 273 additions and 74 deletions

View File

@@ -0,0 +1,304 @@
From d2b98bf18abba445faed19bb2f796f9278f271ed Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Mon, 28 Jul 2014 12:01:53 -0400
Subject: [PATCH] Make FFmpeg 0.10.14 compile on x86_gcc2.
---
cmdutils.c | 2 +-
configure | 12 +++---------
ffmpeg.c | 6 ++++--
ffprobe.c | 15 ++++++++++-----
libavcodec/aacenc.c | 6 ++++--
libavcodec/pngenc.c | 5 +++--
libavutil/pixdesc.c | 16 ----------------
libswscale/swscale_unscaled.c | 32 ++++++++++++++++++++------------
8 files changed, 45 insertions(+), 49 deletions(-)
diff --git a/cmdutils.c b/cmdutils.c
index 01abc51..ea73b8c 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -89,7 +89,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
char line[1024];
static int print_prefix = 1;
- va_copy(vl2, vl);
+ __va_copy(vl2, vl);
av_log_default_callback(ptr, level, fmt, vl);
av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
va_end(vl2);
diff --git a/configure b/configure
index b65cefe..8c6b676 100755
--- a/configure
+++ b/configure
@@ -1369,7 +1369,6 @@ avx_deps="ssse3"
aligned_stack_if_any="ppc x86"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
fast_unaligned_if_any="armv6 ppc x86"
inline_asm_deps="!tms470"
@@ -1876,7 +1875,7 @@ AS_O='-o $@'
CC_O='-o $@'
CXX_O='-o $@'
-host_cflags='-D_ISOC99_SOURCE -O3 -g'
+host_cflags='-D_ISOC99_SOURCE -O2 -g'
host_libs='-lm'
target_path='$(CURDIR)'
@@ -1958,6 +1957,7 @@ for n in $COMPONENT_LIST; do
done
enable $ARCH_EXT_LIST $ALL_TESTS
+disable sse
die_unknown(){
echo "Unknown option \"$1\"."
@@ -2154,7 +2154,7 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi
- speed_cflags='-O3'
+ speed_cflags='-O2'
size_cflags='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
@@ -2841,10 +2841,6 @@ check_cc <<EOF && enable attribute_packed
struct { int x; } __attribute__((packed)) x;
EOF
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
@@ -3116,8 +3112,6 @@ disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
enabled vaapi && require vaapi va/va.h vaInitialize -lva
check_mathfunc cbrtf
-check_mathfunc exp2
-check_mathfunc exp2f
check_mathfunc llrint
check_mathfunc llrintf
check_mathfunc log2
diff --git a/ffmpeg.c b/ffmpeg.c
index 2d2d081..de93ea2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1247,9 +1247,11 @@ need_realloc:
av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong
if (ost->audio_resample) {
+ uint8_t *buftmp2[] = { buftmp };
+ const uint8_t *buf2[] = { buf };
buftmp = audio_buf;
- size_out = swr_convert(ost->swr, ( uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize),
- (const uint8_t*[]){buf }, size / (dec->channels * isize));
+ size_out = swr_convert(ost->swr, buftmp2, audio_buf_size / (enc->channels * osize),
+ buf2, size / (dec->channels * isize));
size_out = size_out * enc->channels * osize;
} else {
buftmp = buf;
diff --git a/ffprobe.c b/ffprobe.c
index 48c813a..be3d3ad 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -293,7 +293,9 @@ static void writer_print_time(WriterContext *wctx, const char *key,
writer_print_string(wctx, key, "N/A", 1);
} else {
double d = ts * av_q2d(*time_base);
- value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str});
+ struct unit_value value2 = {.unit=unit_second_str};
+ value2.val.d = d;
+ value_string(buf, sizeof(buf), value2);
writer_print_string(wctx, key, buf, 0);
}
}
@@ -1249,8 +1251,8 @@ static void writer_register_all(void)
#define print_str_opt(k, v) writer_print_string(w, k, v, 1)
#define print_time(k, v, tb) writer_print_time(w, k, v, tb)
#define print_ts(k, v) writer_print_ts(w, k, v)
-#define print_val(k, v, u) writer_print_string(w, k, \
- value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0)
+#define print_val(k, v, u) value2.val.i = v; value2.unit=u; writer_print_string(w, k, \
+ value_string(val_str, sizeof(val_str), value2), 0);
#define print_section_header(s) writer_print_section_header(w, s)
#define print_section_footer(s) writer_print_section_footer(w, s)
#define show_tags(metadata) writer_show_tags(w, metadata)
@@ -1261,6 +1263,7 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
AVStream *st = fmt_ctx->streams[pkt->stream_index];
struct print_buf pbuf = {.s = NULL};
const char *s;
+ struct unit_value value2;
print_section_header("packet");
s = av_get_media_type_string(st->codec->codec_type);
@@ -1404,6 +1407,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
const char *s;
AVRational display_aspect_ratio;
struct print_buf pbuf = {.s = NULL};
+ struct unit_value value2;
print_section_header("stream");
@@ -1516,6 +1520,7 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
{
char val_str[128];
int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
+ struct unit_value value2;
print_section_header("format");
print_str("filename", fmt_ctx->filename);
@@ -1524,9 +1529,9 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
print_str("format_long_name", fmt_ctx->iformat->long_name);
print_time("start_time", fmt_ctx->start_time, &AV_TIME_BASE_Q);
print_time("duration", fmt_ctx->duration, &AV_TIME_BASE_Q);
- if (size >= 0) print_val ("size", size, unit_byte_str);
+ if (size >= 0) { print_val ("size", size, unit_byte_str); }
else print_str_opt("size", "N/A");
- if (fmt_ctx->bit_rate > 0) print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str);
+ if (fmt_ctx->bit_rate > 0) { print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str); }
else print_str_opt("bit_rate", "N/A");
show_tags(fmt_ctx->metadata);
print_section_footer("format");
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 2ff6f9c..344fbd4 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -223,8 +223,9 @@ WINDOW_FUNC(eight_short)
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *in = audio + 448;
float *out = sce->ret;
+ int w;
- for (int w = 0; w < 8; w++) {
+ for (w = 0; w < 8; w++) {
dsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
out += 128;
in += 128;
@@ -686,11 +687,12 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
{
+ int ch;
FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
- for(int ch = 0; ch < s->channels; ch++)
+ for(ch = 0; ch < s->channels; ch++)
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
return 0;
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index d36914a..103b742 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -54,8 +54,9 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
int x, mask, dst_x, j, b, bpp;
uint8_t *d;
const uint8_t *s;
-
- mask = (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass];
+ int mask_tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
+
+ mask = mask_tmp[pass];
switch(bits_per_pixel) {
case 1:
memset(dst, 0, row_size);
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e73fbfe..3cde56c 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1096,12 +1096,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
.log2_chroma_h = 1,
.flags = PIX_FMT_HWACCEL,
},
- [PIX_FMT_VDA_VLD] = {
- .name = "vda_vld",
- .log2_chroma_w = 1,
- .log2_chroma_h = 1,
- .flags = PIX_FMT_HWACCEL,
- },
[PIX_FMT_GRAY8A] = {
.name = "gray8a",
.nb_components = 2,
@@ -1110,16 +1104,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{ 0, 1, 2, 0, 7 }, /* A */
},
},
- [PIX_FMT_GBR24P] = {
- .name = "gbr24p",
- .nb_components= 3,
- .comp = {
- { 1, 0, 1, 0, 7 }, /* B */
- { 0, 0, 1, 0, 7 }, /* G */
- { 2, 0, 1, 0, 7 }, /* R */
- },
- .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
- },
[PIX_FMT_GBRP] = {
.name = "gbrp",
.nb_components = 3,
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index d4b39f4..b98d38a 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -370,30 +370,38 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStr
}
switch (c->dstFormat) {
- case PIX_FMT_BGR24:
- gbr24ptopacked24((const uint8_t* []) {src[1], src[0], src[2]}, (int []) {srcStride[1], srcStride[0], srcStride[2]},
+ case PIX_FMT_BGR24: {
+ const uint8_t* src2[] = {src[1], src[0], src[2]};
+ int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]};
+ gbr24ptopacked24(src2, srcStride2,
dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW);
break;
-
- case PIX_FMT_RGB24:
- gbr24ptopacked24((const uint8_t* []) {src[2], src[0], src[1]}, (int []) {srcStride[2], srcStride[0], srcStride[1]},
+ }
+ case PIX_FMT_RGB24: {
+ const uint8_t* src2[] = {src[2], src[0], src[1]};
+ int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]};
+ gbr24ptopacked24(src2, srcStride2,
dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW);
break;
-
+ }
case PIX_FMT_ARGB:
alpha_first = 1;
- case PIX_FMT_RGBA:
- gbr24ptopacked32((const uint8_t* []) {src[2], src[0], src[1]}, (int []) {srcStride[2], srcStride[0], srcStride[1]},
+ case PIX_FMT_RGBA: {
+ const uint8_t* src2[] = {src[2], src[0], src[1]};
+ int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]};
+ gbr24ptopacked32(src2, srcStride2,
dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW);
break;
-
+ }
case PIX_FMT_ABGR:
alpha_first = 1;
- case PIX_FMT_BGRA:
- gbr24ptopacked32((const uint8_t* []) {src[1], src[0], src[2]}, (int []) {srcStride[1], srcStride[0], srcStride[2]},
+ case PIX_FMT_BGRA: {
+ const uint8_t* src2[] = {src[1], src[0], src[2]};
+ int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]};
+ gbr24ptopacked32(src2, srcStride2,
dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW);
break;
-
+ }
default:
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
--
1.8.3.4