Permalink
Browse files

FFmpeg adjustment.

This commit tries to minimise the changes made on the original FFmpeg libs so it is easier to sync in the future. It also fixes some errors introduced during the last resync.

Lots of MMX code were relying on mmx.h header which was removed from ffmpeg years ago. So copy it into libmythbase so we never have to bother about this files again and modify all files using that header

There are still changes in libavcodec's PPC code, but I wouldn't dare touching it.
  • Loading branch information...
1 parent 133538c commit 106132b22e9273ffc67abf098d8022df655da630 @jyavenard jyavenard committed May 22, 2012
@@ -716,10 +716,6 @@ static int decode_audio_specific_config(AACContext *ac,
m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
m4ac->sample_rate, m4ac->sbr, m4ac->ps);
- av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
- m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
- m4ac->sample_rate, m4ac->sbr, m4ac->ps);
-
return get_bits_count(&gb);
}
@@ -2597,8 +2593,6 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
latmctx->initialized = 0;
- ac->m4ac= m4ac;
-
esize = (bits_consumed+7) / 8;
if (avctx->extradata_size < esize) {
@@ -2775,7 +2769,6 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
*got_frame_ptr = 0;
return avpkt->size;
} else {
- aac_decode_close(avctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.m4ac,
avctx->extradata, avctx->extradata_size*8, 1)) < 0)
@@ -405,9 +405,6 @@ void avcodec_register_all(void)
REGISTER_DECODER (LIBCELT, libcelt);
REGISTER_DECODER (LIBDIRAC, libdirac);
REGISTER_ENCODER (LIBFAAC, libfaac);
-#if 0
- REGISTER_DECODER (LIBFAAD_LATM, libfaad_latm);
-#endif
REGISTER_ENCDEC (LIBGSM, libgsm);
REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms);
REGISTER_ENCODER (LIBMP3LAME, libmp3lame);
@@ -1,5 +1,3 @@
-HEADERS += x86/mmx.h
-
OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
@@ -1953,34 +1953,31 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
"pmullw %%mm5, %%mm2 \n\t" // (s - dx) * dy
"pmullw %%mm4, %%mm1 \n\t" // dx * (s - dy)
- "movd %1, %%mm5 \n\t"
- "movd %0, %%mm4 \n\t"
+ "movd %4, %%mm5 \n\t"
+ "movd %3, %%mm4 \n\t"
"punpcklbw %%mm7, %%mm5 \n\t"
"punpcklbw %%mm7, %%mm4 \n\t"
"pmullw %%mm5, %%mm3 \n\t" // src[1, 1] * dx * dy
"pmullw %%mm4, %%mm2 \n\t" // src[0, 1] * (s - dx) * dy
- :
- : "m"(src[stride]), "m"(src[stride+1])
- );
- __asm__ volatile(
"movd %2, %%mm5 \n\t"
"movd %1, %%mm4 \n\t"
"punpcklbw %%mm7, %%mm5 \n\t"
"punpcklbw %%mm7, %%mm4 \n\t"
"pmullw %%mm5, %%mm1 \n\t" // src[1, 0] * dx * (s - dy)
"pmullw %%mm4, %%mm0 \n\t" // src[0, 0] * (s - dx) * (s - dy)
- "paddw %3, %%mm1 \n\t"
+ "paddw %5, %%mm1 \n\t"
"paddw %%mm3, %%mm2 \n\t"
"paddw %%mm1, %%mm0 \n\t"
"paddw %%mm2, %%mm0 \n\t"
- "psrlw %4, %%mm0 \n\t"
+ "psrlw %6, %%mm0 \n\t"
"packuswb %%mm0, %%mm0 \n\t"
"movd %%mm0, %0 \n\t"
: "=m"(dst[x + y * stride])
: "m"(src[0]), "m"(src[1]),
+ "m"(src[stride]), "m"(src[stride + 1]),
"m"(*r4), "m"(shift2)
);
src += stride;
@@ -63,8 +63,8 @@ extern const xmm_reg ff_pb_F8;
extern const uint64_t ff_pb_FC;
extern const xmm_reg ff_pb_FE;
-extern const double __attribute__((visibility("hidden"))) ff_pd_1[2];
-extern const double __attribute__((visibility("hidden"))) ff_pd_2[2];
+extern const double ff_pd_1[2];
+extern const double ff_pd_2[2];
#define LOAD4(stride,in,a,b,c,d)\
"movq 0*"#stride"+"#in", "#a"\n\t"\
@@ -98,7 +98,7 @@ typedef struct {
* @param desc_list_end End of buffer
* @return <0 to stop processing
*/
-int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type,
+int ff_old_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type,
const uint8_t **pp, const uint8_t *desc_list_end,
Mp4Descr *mp4_descr, int mp4_descr_count, int pid,
MpegTSContext *ts);
@@ -39,7 +39,7 @@
#include "libavutil/parseutils.h"
#include "riff.h"
#include "audiointerleave.h"
-#include "mpegts.h"
+#include "mpegts-mythtv.h"
#include "url.h"
#include <sys/time.h>
#include <time.h>
@@ -1022,7 +1022,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
// Note, if this is misbehaving for a H.264 file then possibly presentation_delayed is not set correctly.
if(delay==1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE && presentation_delayed){
av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination %"PRIi64"\n", pkt->dts);
- pkt->pts= AV_NOPTS_VALUE;
+ pkt->dts= AV_NOPTS_VALUE;
}
if (pkt->duration == 0) {
@@ -1283,8 +1283,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
AVStream *st;
AVPacket cur_pkt;
- cur_pkt.data = NULL;
- cur_pkt.size = 0;
+ av_destruct_packet_nofree(&cur_pkt);
+ av_init_packet(&cur_pkt);
/* read next packet */
ret = ff_read_packet(s, &cur_pkt);
@@ -2520,7 +2520,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
count = 0;
read_size = 0;
-
for(;;) {
if (ff_check_interrupt(&ic->interrupt_callback)){
ret= AVERROR_EXIT;
@@ -3686,7 +3685,6 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
/**
* Interleave an AVPacket correctly so it can be muxed.
- *
* @param out the interleaved packet will be output here
* @param in the input packet
* @param flush 1 if no further packets are available as input and all
@@ -4012,7 +4010,6 @@ uint64_t ff_ntp_time(void)
int av_get_frame_filename(char *buf, int buf_size,
const char *path, int number)
{
- struct tm time_r;
const char *p;
char *q, buf1[20], c;
int nd, len, percentd_found;
@@ -39,7 +39,6 @@
#include "timer.h"
#include "cpu.h"
#include "dict.h"
-#include "intmath.h"
struct AVDictionary {
int count;
@@ -1,7 +1,7 @@
include $(SUBDIR)../config.mak
NAME = swscale
-FFLIBS = avcodec avutil
+FFLIBS = avutil
HEADERS = swscale.h
@@ -49,8 +49,6 @@
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
-#include "libavutil/cpu.h"
-
unsigned swscale_version(void)
{
av_assert0(LIBSWSCALE_VERSION_MICRO >= 100);
@@ -19,7 +19,7 @@
#include "libavutil/mem.h"
#include "libavcodec/dsputil.h"
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
static const mmx_t mm_cpool[] = {
{ w: {1, 1, 1, 1} },
@@ -23,7 +23,7 @@
#include "libavcodec/dsputil.h"
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
//static const char FILTER_NAME[] = "crop";
@@ -29,7 +29,7 @@
#define ABS(A) ( (A) > 0 ? (A) : -(A) )
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
static const mmx_t mz = { 0x0LL };
#endif
@@ -36,7 +36,7 @@
#include "color.h"
#if HAVE_MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
void (*yv12_to_yuy2)
@@ -64,7 +64,7 @@ static unsigned int GreedyMotionSense = MOTIONSENSE_DEFAULT;
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
static const mmx_t mm_cpool[] =
{
@@ -25,7 +25,7 @@
#define CLAMP(A,L,U) ((A)>(U)?(U):((A)<(L)?(L):(A)))
#if HAVE_MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#define THRESHOLD 12
static const mmx_t mm_lthr = { w:{ -THRESHOLD, -THRESHOLD,
-THRESHOLD, -THRESHOLD} };
@@ -9,7 +9,7 @@
#endif
#if HAVE_MMX || HAVE_AMD3DNOW
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
#include "../mm_arch.h"
@@ -26,7 +26,7 @@
#include "libavcodec/dsputil.h"
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
//Regular filter
@@ -45,7 +45,7 @@
#include "../mm_arch.h"
#if HAVE_MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
#include "aclib.h"
@@ -52,7 +52,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#endif
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#endif
/* Format definitions */
@@ -2,7 +2,7 @@
#ifdef MMX
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
static const mmx_t mm_cpool[] =
{
@@ -82,7 +82,7 @@ using_valgrind:DEFINES += USING_VALGRIND
# mmx macros from avlib
contains( HAVE_MMX, yes ) {
- HEADERS += ../../external/FFmpeg/libavcodec/x86/mmx.h ../../external/FFmpeg/libavcodec/dsputil.h
+ HEADERS += ../libmythbase/ffmpeg-mmx.h ../../external/FFmpeg/libavcodec/dsputil.h
}
QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)
@@ -17,7 +17,7 @@
#ifdef MMX
extern "C" {
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
}
#endif
@@ -7,7 +7,7 @@
#ifdef MMX
extern "C" {
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
}
static mmx_t mmx_1s = {0xffffffffffffffffLL};
@@ -1,7 +1,7 @@
#ifndef GOOM_MMX_H
#include <mythconfig.h>
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
#define MM_MMX 0x0001 /* standard MMX */
#define MM_3DNOW 0x0004 /* AMD 3DNOW */
@@ -33,7 +33,7 @@
#if HAVE_MMX
extern "C" {
-#include "libavcodec/x86/mmx.h"
+#include "ffmpeg-mmx.h"
}
#define CPU_MMXEXT 0
#define CPU_MMX 1

0 comments on commit 106132b

Please sign in to comment.