summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Jamfile8
-rwxr-xr-xconfigure1
-rw-r--r--contrib/Jamfile48
-rw-r--r--contrib/patch-ffmpeg-macintel.patch (renamed from contrib/ffmpeg.patch)127
-rw-r--r--contrib/patch-ffmpeg.patch68
-rw-r--r--contrib/version_ffmpeg.txt2
-rw-r--r--contrib/version_mpeg4ip.txt1
-rw-r--r--libhb/common.c1
-rw-r--r--libhb/common.h5
-rw-r--r--libhb/encavcodec.c14
-rw-r--r--libhb/encfaac.c8
-rw-r--r--libhb/encx264.c60
-rw-r--r--libhb/hb.c23
-rw-r--r--libhb/internal.h8
-rw-r--r--libhb/muxcommon.c1
-rw-r--r--libhb/muxmp4.c196
-rw-r--r--libhb/work.c3
-rw-r--r--macosx/English.lproj/Express.nib/info.nib4
-rw-r--r--macosx/English.lproj/Express.nib/keyedobjects.nibbin34653 -> 34816 bytes
-rw-r--r--macosx/ExpressController.m34
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj20
21 files changed, 349 insertions, 283 deletions
diff --git a/Jamfile b/Jamfile
index 8066a1bd9..fb1229ab2 100644
--- a/Jamfile
+++ b/Jamfile
@@ -8,10 +8,10 @@ SubDir TOP ;
# libhb + contrib libraries
HB_LIBS = libhb.a
- contrib/lib/liba52.a contrib/lib/libavcodec.a
- contrib/lib/libavutil.a contrib/lib/libdvdread.a
- contrib/lib/libdvdcss.a contrib/lib/libfaac.a
- contrib/lib/libmp3lame.a contrib/lib/libmp4v2.a
+ contrib/lib/liba52.a contrib/lib/libavformat.a
+ contrib/lib/libavcodec.a contrib/lib/libavutil.a
+ contrib/lib/libdvdread.a contrib/lib/libdvdcss.a
+ contrib/lib/libfaac.a contrib/lib/libmp3lame.a
contrib/lib/libmpeg2.a contrib/lib/libvorbis.a
contrib/lib/libvorbisenc.a contrib/lib/libogg.a
contrib/lib/libsamplerate.a contrib/lib/libx264.a
diff --git a/configure b/configure
index d0c292873..abe2b1779 100755
--- a/configure
+++ b/configure
@@ -4,6 +4,7 @@ CC="gcc"
CXX="g++"
CCFLAGS="$CCFLAGS -Wall -g"
OPTIM="$OPTIM -O3 -funroll-loops"
+LINKLIBS="-lz"
# System-specific flags
SYSTEM=`uname -s`
diff --git a/contrib/Jamfile b/contrib/Jamfile
index 3271a46ee..908fc38a0 100644
--- a/contrib/Jamfile
+++ b/contrib/Jamfile
@@ -42,14 +42,11 @@ LibA52 $(SUBDIR)/lib/liba52.a : $(SUBDIR)/a52dec.tar.gz ;
# libavcodec
rule LibAvCodec
{
+ FFMPEG_PATCH = "patch -p1 < ../patch-ffmpeg.patch" ;
if $(OS) = MACOSX && $(OSPLAT) = X86
{
- FFMPEG_OPTIONS = --enable-memalign-hack ;
- FFMPEG_PATCH = "patch -p1 < ../ffmpeg.patch" ;
- }
- else
- {
- FFMPEG_PATCH = true ;
+ FFMPEG_OPTIONS = --enable-memalign-hack ;
+ FFMPEG_PATCH += " && patch -p1 < ../patch-ffmpeg-macintel.patch" ;
}
Depends $(<) : $(>) ;
Depends lib : $(<) ;
@@ -57,11 +54,10 @@ rule LibAvCodec
actions LibAvCodec
{
cd `dirname $(>)` && CONTRIB=`pwd` &&
- rm -rf ffmpeg && tar xzf ffmpeg.tar.gz && cd ffmpeg &&
- $(FFMPEG_PATCH) &&
- ./configure --prefix=$CONTRIB $(FFMPEG_OPTIONS) --enable-gpl &&
- make -C libavcodec && make -C libavutil &&
- make -C libavcodec installlib && make -C libavutil installlib &&
+ rm -rf ffmpeg-20060326 && tar xzf ffmpeg.tar.gz &&
+ cd ffmpeg-20060326 && $(FFMPEG_PATCH) &&
+ ./configure --prefix=$CONTRIB $(FFMPEG_OPTIONS) --enable-gpl --disable-audio-beos &&
+ make lib && make install-libs install-headers &&
strip -S $CONTRIB/lib/libavcodec.a
}
Wget $(SUBDIR)/ffmpeg.tar.gz : $(SUBDIR)/version_ffmpeg.txt ;
@@ -78,6 +74,17 @@ actions LibAvUtil
}
LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ;
+rule LibAvFormat
+{
+ Depends $(<) : $(>) ;
+ Depends lib : $(<) ;
+}
+actions LibAvFormat
+{
+ strip -S $(<)
+}
+LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ;
+
# libdvdcss
# We need libdvdcss.so for libdvdread's configure to work...
rule LibDvdCss
@@ -146,25 +153,6 @@ actions LibMp3Lame
Wget $(SUBDIR)/lame.tar.gz : $(SUBDIR)/version_lame.txt ;
LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ;
-# libmp4v2
-rule LibMp4v2
-{
- Depends $(<) : $(>) ;
- Depends lib : $(<) ;
-}
-actions LibMp4v2
-{
- cd `dirname $(>)` && CONTRIB=`pwd` &&
- rm -rf mpeg4ip && tar xzf mpeg4ip.tar.gz && cd mpeg4ip &&
- ./bootstrap && make -C lib/mp4v2 libmp4v2.la &&
- cp lib/mp4v2/.libs/libmp4v2.a $CONTRIB/lib &&
- cp mpeg4ip_config.h include/mpeg4ip.h include/mpeg4ip_version.h \
- include/mpeg4ip_win32.h lib/mp4v2/mp4.h $CONTRIB/include &&
- strip -S $CONTRIB/lib/libmp4v2.a
-}
-Wget $(SUBDIR)/mpeg4ip.tar.gz : $(SUBDIR)/version_mpeg4ip.txt ;
-LibMp4v2 $(SUBDIR)/lib/libmp4v2.a : $(SUBDIR)/mpeg4ip.tar.gz ;
-
# libmpeg2
rule LibMpeg2
{
diff --git a/contrib/ffmpeg.patch b/contrib/patch-ffmpeg-macintel.patch
index c507502c2..ecc0dc6c4 100644
--- a/contrib/ffmpeg.patch
+++ b/contrib/patch-ffmpeg-macintel.patch
@@ -1,6 +1,6 @@
-diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx.c ffmpeg/libavcodec/i386/dsputil_mmx.c
---- ffmpeg.orig/libavcodec/i386/dsputil_mmx.c 2006-01-12 23:43:17.000000000 +0100
-+++ ffmpeg/libavcodec/i386/dsputil_mmx.c 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx.c ffmpeg-20060326/libavcodec/i386/dsputil_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx.c 2006-03-26 22:13:32.000000000 +0200
@@ -52,7 +52,7 @@
static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL;
@@ -55,9 +55,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx.c ffmpeg/libavcodec/i386/dsputi
"1: \n\t"
"movq (%1), %%mm0 \n\t"
"movq 8(%1), %%mm4 \n\t"
-diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx_avg.h ffmpeg/libavcodec/i386/dsputil_mmx_avg.h
---- ffmpeg.orig/libavcodec/i386/dsputil_mmx_avg.h 2006-01-12 23:43:17.000000000 +0100
-+++ ffmpeg/libavcodec/i386/dsputil_mmx_avg.h 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_avg.h ffmpeg-20060326/libavcodec/i386/dsputil_mmx_avg.h
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_avg.h 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx_avg.h 2006-03-26 22:13:51.000000000 +0200
@@ -754,7 +754,7 @@
"lea (%3, %3), %%"REG_a" \n\t"
"movq (%1), %%mm0 \n\t"
@@ -67,9 +67,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx_avg.h ffmpeg/libavcodec/i386/ds
"1: \n\t"
"movq (%1, %%"REG_a"), %%mm2 \n\t"
"movq (%1, %3), %%mm1 \n\t"
-diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx_rnd.h ffmpeg/libavcodec/i386/dsputil_mmx_rnd.h
---- ffmpeg.orig/libavcodec/i386/dsputil_mmx_rnd.h 2006-01-12 23:43:17.000000000 +0100
-+++ ffmpeg/libavcodec/i386/dsputil_mmx_rnd.h 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_rnd.h ffmpeg-20060326/libavcodec/i386/dsputil_mmx_rnd.h
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_rnd.h 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx_rnd.h 2006-03-26 22:15:09.000000000 +0200
@@ -28,7 +28,7 @@
MOVQ_BFE(mm6);
__asm __volatile(
@@ -142,10 +142,10 @@ diff -ru ffmpeg.orig/libavcodec/i386/dsputil_mmx_rnd.h ffmpeg/libavcodec/i386/ds
"1: \n\t"
"movq (%1, %%"REG_a"), %%mm0 \n\t"
"movq 1(%1, %%"REG_a"), %%mm2 \n\t"
-diff -ru ffmpeg.orig/libavcodec/i386/fdct_mmx.c ffmpeg/libavcodec/i386/fdct_mmx.c
---- ffmpeg.orig/libavcodec/i386/fdct_mmx.c 2005-12-22 02:10:09.000000000 +0100
-+++ ffmpeg/libavcodec/i386/fdct_mmx.c 2006-02-01 06:10:53.000000000 +0100
-@@ -350,61 +350,67 @@
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/fdct_mmx.c ffmpeg-20060326/libavcodec/i386/fdct_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/fdct_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/fdct_mmx.c 2006-03-26 22:19:01.000000000 +0200
+@@ -350,61 +350,61 @@
static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
{
@@ -218,12 +218,6 @@ diff -ru ffmpeg.orig/libavcodec/i386/fdct_mmx.c ffmpeg/libavcodec/i386/fdct_mmx.
- "packssdw %%xmm3, %%xmm1 \n\t"
- "movdqa %%xmm1, \\i(%4) \n\t"
- ".endm \n\t"
-+// ".macro FDCT_ROW_SSE2_H1 i t \n\t"
-+// ".endm \n\t"
-+// ".macro FDCT_ROW_SSE2_H2 i t \n\t"
-+// ".endm \n\t"
-+// ".macro FDCT_ROW_SSE2 i \n\t"
-+// ".endm \n\t"
"movdqa (%2), %%xmm6 \n\t"
- "FDCT_ROW_SSE2_H1 0 0 \n\t"
- "FDCT_ROW_SSE2 0 \n\t"
@@ -266,9 +260,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/fdct_mmx.c ffmpeg/libavcodec/i386/fdct_mmx.
:
: "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2), "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
);
-diff -ru ffmpeg.orig/libavcodec/i386/idct_mmx_xvid.c ffmpeg/libavcodec/i386/idct_mmx_xvid.c
---- ffmpeg.orig/libavcodec/i386/idct_mmx_xvid.c 2006-01-12 23:43:18.000000000 +0100
-+++ ffmpeg/libavcodec/i386/idct_mmx_xvid.c 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/idct_mmx_xvid.c ffmpeg-20060326/libavcodec/i386/idct_mmx_xvid.c
+--- ffmpeg-20060326-bak/libavcodec/i386/idct_mmx_xvid.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/idct_mmx_xvid.c 2006-03-26 22:20:28.000000000 +0200
@@ -295,17 +295,17 @@
"movq 8+" #A1 ",%%mm1 \n\t"/* 1 ; x7 x6 x5 x4*/\
"movq %%mm0,%%mm2 \n\t"/* 2 ; x3 x2 x1 x0*/\
@@ -300,9 +294,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/idct_mmx_xvid.c ffmpeg/libavcodec/i386/idct
"movq %%mm7,8 +" #A2 "\n\t"/* 7 ; save y7 y6 y5 y4*/\
-diff -ru ffmpeg.orig/libavcodec/i386/motion_est_mmx.c ffmpeg/libavcodec/i386/motion_est_mmx.c
---- ffmpeg.orig/libavcodec/i386/motion_est_mmx.c 2006-01-12 23:43:18.000000000 +0100
-+++ ffmpeg/libavcodec/i386/motion_est_mmx.c 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/motion_est_mmx.c ffmpeg-20060326/libavcodec/i386/motion_est_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/motion_est_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/motion_est_mmx.c 2006-03-26 22:24:48.000000000 +0200
@@ -34,7 +34,7 @@
{
long len= -(stride*h);
@@ -357,9 +351,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/motion_est_mmx.c ffmpeg/libavcodec/i386/mot
"1: \n\t"
"movq (%1, %%"REG_a"), %%mm0 \n\t"
"movq (%2, %%"REG_a"), %%mm1 \n\t"
-diff -ru ffmpeg.orig/libavcodec/i386/mpegvideo_mmx.c ffmpeg/libavcodec/i386/mpegvideo_mmx.c
---- ffmpeg.orig/libavcodec/i386/mpegvideo_mmx.c 2006-01-12 23:43:18.000000000 +0100
-+++ ffmpeg/libavcodec/i386/mpegvideo_mmx.c 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx.c ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx.c 2006-03-26 22:25:09.000000000 +0200
@@ -66,7 +66,7 @@
"packssdw %%mm5, %%mm5 \n\t"
"psubw %%mm5, %%mm7 \n\t"
@@ -414,9 +408,9 @@ diff -ru ffmpeg.orig/libavcodec/i386/mpegvideo_mmx.c ffmpeg/libavcodec/i386/mpeg
"1: \n\t"
"movq (%0, %%"REG_a"), %%mm0 \n\t"
"movq 8(%0, %%"REG_a"), %%mm1 \n\t"
-diff -ru ffmpeg.orig/libavcodec/i386/mpegvideo_mmx_template.c ffmpeg/libavcodec/i386/mpegvideo_mmx_template.c
---- ffmpeg.orig/libavcodec/i386/mpegvideo_mmx_template.c 2006-01-12 23:43:18.000000000 +0100
-+++ ffmpeg/libavcodec/i386/mpegvideo_mmx_template.c 2006-02-01 06:10:53.000000000 +0100
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx_template.c ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx_template.c
+--- ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx_template.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx_template.c 2006-03-26 22:25:33.000000000 +0200
@@ -111,7 +111,7 @@
"pxor %%mm6, %%mm6 \n\t"
"psubw (%3), %%mm6 \n\t" // -bias[0]
@@ -435,10 +429,10 @@ diff -ru ffmpeg.orig/libavcodec/i386/mpegvideo_mmx_template.c ffmpeg/libavcodec/
"1: \n\t"
"pxor %%mm1, %%mm1 \n\t" // 0
"movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
-diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/simple_idct_mmx.c
---- ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c 2006-01-12 23:43:18.000000000 +0100
-+++ ffmpeg/libavcodec/i386/simple_idct_mmx.c 2006-02-01 06:10:53.000000000 +0100
-@@ -459,13 +459,12 @@
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/simple_idct_mmx.c ffmpeg-20060326/libavcodec/i386/simple_idct_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/simple_idct_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/simple_idct_mmx.c 2006-03-26 22:39:09.000000000 +0200
+@@ -459,10 +459,10 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -452,11 +446,8 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
+COL_IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
#else
--
- #define DC_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
-@@ -783,10 +782,10 @@
+
+@@ -783,10 +783,10 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -471,7 +462,7 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
"#.balign 16 \n\t"\
-@@ -860,10 +859,10 @@
+@@ -860,10 +860,10 @@
"movd %%mm5, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -486,7 +477,7 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
"#.balign 16 \n\t"\
-@@ -928,10 +927,10 @@
+@@ -928,10 +928,10 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -501,7 +492,7 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
"#.balign 16 \n\t"\
-@@ -1007,10 +1006,10 @@
+@@ -1007,10 +1007,10 @@
"movd %%mm5, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -516,7 +507,7 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
"#.balign 16 \n\t"\
-@@ -1073,10 +1072,10 @@
+@@ -1073,10 +1073,10 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -531,22 +522,19 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
"#.balign 16 \n\t"\
-@@ -1141,10 +1140,10 @@
+@@ -1141,9 +1141,9 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
--//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
--IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
--//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
+IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
-+//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
+ //IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
-+//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ //IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
"jmp 9f \n\t"
-
-@@ -1217,10 +1216,10 @@
+@@ -1217,10 +1217,10 @@
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
@@ -561,42 +549,15 @@ diff -ru ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c ffmpeg/libavcodec/i386/si
"jmp 9f \n\t"
-@@ -1259,10 +1258,10 @@
+@@ -1259,9 +1259,9 @@
"movq %%mm0, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
--//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
--IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
--//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
+IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
-+//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
+ //IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
-+//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ //IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
- #endif
-diff -ru ffmpeg.orig/libavcodec/libpostproc/mangle.h ffmpeg/libavcodec/libpostproc/mangle.h
---- ffmpeg.orig/libavcodec/libpostproc/mangle.h 2004-12-18 04:07:15.000000000 +0100
-+++ ffmpeg/libavcodec/libpostproc/mangle.h 2006-02-01 06:10:53.000000000 +0100
-@@ -19,6 +19,8 @@
- #else
- #if defined(ARCH_X86_64) && defined(PIC)
- #define MANGLE(a) #a"(%%rip)"
-+#elif defined(CONFIG_DARWIN)
-+#define MANGLE(a) "_" #a
- #else
- #define MANGLE(a) #a
- #endif
-diff -ru ffmpeg.orig/libavutil/common.h ffmpeg/libavutil/common.h
---- ffmpeg.orig/libavutil/common.h 2006-01-30 01:22:41.000000000 +0100
-+++ ffmpeg/libavutil/common.h 2006-02-01 06:10:53.000000000 +0100
-@@ -267,6 +267,8 @@
- # else
- # if defined(ARCH_X86_64) && defined(PIC)
- # define MANGLE(a) #a"(%%rip)"
-+# elif defined(CONFIG_DARWIN)
-+# define MANGLE(a) "_" #a
- # else
- # define MANGLE(a) #a
- # endif
diff --git a/contrib/patch-ffmpeg.patch b/contrib/patch-ffmpeg.patch
new file mode 100644
index 000000000..cd482bd17
--- /dev/null
+++ b/contrib/patch-ffmpeg.patch
@@ -0,0 +1,68 @@
+diff -ru ffmpeg-20060326-bak/configure ffmpeg-20060326/configure
+--- ffmpeg-20060326-bak/configure 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/configure 2006-03-30 13:29:36.000000000 +0200
+@@ -272,7 +272,7 @@
+ 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
+ mmx="no"
+ ;;
+-*20010315*) echo "BeBits gcc"
++*20010315*|2.95.3*) echo "BeBits gcc"
+ CFLAGS="$CFLAGS -fno-expensive-optimizations"
+ ;;
+ esac
+diff -ru ffmpeg-20060326-bak/libavformat/movenc.c ffmpeg-20060326/libavformat/movenc.c
+--- ffmpeg-20060326-bak/libavformat/movenc.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavformat/movenc.c 2006-03-30 13:31:03.000000000 +0200
+@@ -22,6 +22,10 @@
+ #include "avio.h"
+ #include "mov.h"
+
++#ifndef UINT32_MAX
++#define UINT32_MAX (4294967295U)
++#endif
++
+ #undef NDEBUG
+ #include <assert.h>
+
+@@ -435,11 +439,6 @@
+ end = track->vosData + track->vosLen;
+
+ put_byte(pb, 1); /* version */
+- put_byte(pb, 77); /* profile */
+- put_byte(pb, 64); /* profile compat */
+- put_byte(pb, 30); /* level */
+- put_byte(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */
+- put_byte(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */
+
+ /* look for sps and pps */
+ while (buf < end) {
+@@ -458,6 +457,12 @@
+ }
+ assert(sps);
+ assert(pps);
++
++ put_byte(pb, sps[1]); /* profile */
++ put_byte(pb, sps[2]); /* profile compat */
++ put_byte(pb, sps[3]); /* level */
++ put_byte(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */
++ put_byte(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */
+ put_be16(pb, sps_size);
+ put_buffer(pb, sps, sps_size);
+ put_byte(pb, 1); /* number of pps */
+diff -ru ffmpeg-20060326-bak/libavformat/tcp.c ffmpeg-20060326/libavformat/tcp.c
+--- ffmpeg-20060326-bak/libavformat/tcp.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavformat/tcp.c 2006-03-30 13:29:36.000000000 +0200
+@@ -112,11 +112,13 @@
+ break;
+ }
+
++#ifndef __BEOS__
+ /* test error */
+ optlen = sizeof(ret);
+ getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
+ if (ret != 0)
+ goto fail;
++#endif
+ }
+ s->fd = fd;
+ return 0;
diff --git a/contrib/version_ffmpeg.txt b/contrib/version_ffmpeg.txt
index fb7435f65..a13a33806 100644
--- a/contrib/version_ffmpeg.txt
+++ b/contrib/version_ffmpeg.txt
@@ -1 +1 @@
-http://download.m0k.org/handbrake/contrib/ffmpeg-20060201.tar.gz
+http://download.m0k.org/handbrake/contrib/ffmpeg-20060326.tar.gz
diff --git a/contrib/version_mpeg4ip.txt b/contrib/version_mpeg4ip.txt
deleted file mode 100644
index f60e5972a..000000000
--- a/contrib/version_mpeg4ip.txt
+++ /dev/null
@@ -1 +0,0 @@
-http://download.m0k.org/handbrake/contrib/mpeg4ip-1.3.tar.gz
diff --git a/libhb/common.c b/libhb/common.c
index 7bd125c84..c9650ab4b 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -115,6 +115,7 @@ int hb_calc_bitrate( hb_job_t * job, int size )
switch( job->mux )
{
case HB_MUX_MP4:
+ case HB_MUX_PSP:
overhead = 6;
break;
case HB_MUX_AVI:
diff --git a/libhb/common.h b/libhb/common.h
index dea4a4800..a0c22ff27 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -155,8 +155,9 @@ struct hb_job_s
file: file path */
#define HB_MUX_MASK 0xFF0000
#define HB_MUX_MP4 0x010000
-#define HB_MUX_AVI 0x020000
-#define HB_MUX_OGM 0x040000
+#define HB_MUX_PSP 0x020000
+#define HB_MUX_AVI 0x040000
+#define HB_MUX_OGM 0x080000
int mux;
char * file;
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index 155ff9b3e..f04606906 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -65,10 +65,14 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
context->gop_size = 10 * job->vrate / job->vrate_base;
context->pix_fmt = PIX_FMT_YUV420P;
- if( job->mux & HB_MUX_MP4 )
+ if( job->mux & ( HB_MUX_MP4 | HB_MUX_PSP ) )
{
context->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
+ if( job->mux & HB_MUX_PSP )
+ {
+ context->flags |= CODEC_FLAG_BITEXACT;
+ }
if( job->grayscale )
{
context->flags |= CODEC_FLAG_GRAY;
@@ -110,11 +114,17 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
}
pv->context = context;
- if( ( job->mux & HB_MUX_MP4 ) && job->pass != 1 )
+ if( ( job->mux & ( HB_MUX_MP4 | HB_MUX_PSP ) ) && job->pass != 1 )
{
+#if 0
/* Hem hem */
w->config->mpeg4.length = 15;
memcpy( w->config->mpeg4.bytes, context->extradata + 15, 15 );
+#else
+ w->config->mpeg4.length = context->extradata_size;
+ memcpy( w->config->mpeg4.bytes, context->extradata,
+ context->extradata_size );
+#endif
}
return 0;
diff --git a/libhb/encfaac.c b/libhb/encfaac.c
index 4c0d19e72..8e2bd4355 100644
--- a/libhb/encfaac.c
+++ b/libhb/encfaac.c
@@ -42,9 +42,11 @@ hb_work_object_t hb_encfaac =
int encfaacInit( hb_work_object_t * w, hb_job_t * job )
{
hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) );
- w->private_data = pv;
-
faacEncConfigurationPtr cfg;
+ uint8_t * bytes;
+ unsigned long length;
+
+ w->private_data = pv;
pv->job = job;
@@ -67,8 +69,6 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
hb_log( "faacEncSetConfiguration failed" );
}
- uint8_t * bytes;
- unsigned long length;
if( faacEncGetDecoderSpecificInfo( pv->faac, &bytes, &length ) < 0 )
{
hb_log( "faacEncGetDecoderSpecificInfo failed" );
diff --git a/libhb/encx264.c b/libhb/encx264.c
index 806fc4c88..13faadc39 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -43,6 +43,7 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
x264_param_t param;
x264_nal_t * nal;
int nal_count;
+ int i, size;
hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) );
w->private_data = pv;
@@ -63,6 +64,7 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
param.i_log_level = X264_LOG_NONE;
if( job->h264_13 )
{
+ param.i_threads = 1;
param.b_cabac = 0;
param.i_level_idc = 13;
}
@@ -98,17 +100,17 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
hb_log( "encx264: opening libx264 (pass %d)", job->pass );
pv->x264 = x264_encoder_open( &param );
- x264_encoder_headers( pv->x264, &nal, &nal_count );
+ w->config->mpeg4.length = 0;
- /* Sequence Parameter Set */
- w->config->h264.sps_length = 1 + nal[1].i_payload;
- w->config->h264.sps[0] = 0x67;
- memcpy( &w->config->h264.sps[1], nal[1].p_payload, nal[1].i_payload );
+ x264_encoder_headers( pv->x264, &nal, &nal_count );
- /* Picture Parameter Set */
- w->config->h264.pps_length = 1 + nal[2].i_payload;
- w->config->h264.pps[0] = 0x68;
- memcpy( &w->config->h264.pps[1], nal[2].p_payload, nal[2].i_payload );
+ for( i = 0; i < nal_count; i++ )
+ {
+ size = sizeof( w->config->mpeg4.bytes ) - w->config->mpeg4.length;
+ x264_nal_encode( &w->config->mpeg4.bytes[w->config->mpeg4.length],
+ &size, 1, &nal[i] );
+ w->config->mpeg4.length += size;
+ }
x264_picture_alloc( &pv->pic_in, X264_CSP_I420,
job->width, job->height );
@@ -158,51 +160,19 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
/* Should be way too large */
buf = hb_buffer_init( 3 * job->width * job->height / 2 );
- buf->size = 0;
buf->start = in->start;
buf->stop = in->stop;
- buf->key = 0;
+ buf->key = ( pv->pic_out.i_type == X264_TYPE_IDR );
+ buf->size = 0;
for( i = 0; i < i_nal; i++ )
{
int size, data;
-
data = buf->alloc - buf->size;
- if( ( size = x264_nal_encode( buf->data + buf->size, &data,
- 1, &nal[i] ) ) < 1 )
+ if( ( size = x264_nal_encode( &buf->data[buf->size], &data,
+ 1, &nal[i] ) ) > 0 )
{
- continue;
- }
-
- if( job->mux & HB_MUX_AVI )
- {
- if( nal[i].i_ref_idc == NAL_PRIORITY_HIGHEST )
- {
- buf->key = 1;
- }
buf->size += size;
- continue;
- }
-
- /* H.264 in .mp4 */
- switch( buf->data[buf->size+4] & 0x1f )
- {
- case 0x7:
- case 0x8:
- /* SPS, PPS */
- break;
-
- default:
- /* H.264 in mp4 (stolen from mp4creator) */
- buf->data[buf->size+0] = ( ( size - 4 ) >> 24 ) & 0xFF;
- buf->data[buf->size+1] = ( ( size - 4 ) >> 16 ) & 0xFF;
- buf->data[buf->size+2] = ( ( size - 4 ) >> 8 ) & 0xFF;
- buf->data[buf->size+3] = ( ( size - 4 ) >> 0 ) & 0xFF;
- if( nal[i].i_ref_idc == NAL_PRIORITY_HIGHEST )
- {
- buf->key = 1;
- }
- buf->size += size;
}
}
diff --git a/libhb/hb.c b/libhb/hb.c
index 7bc41be8e..d44c05de6 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -260,6 +260,7 @@ void hb_set_size( hb_job_t * job, int aspect, int pixels )
int croppedAspect = title->aspect * title->height * croppedWidth /
croppedHeight / title->width;
int addCrop;
+ int i, w, h;
if( aspect <= 0 )
{
@@ -296,11 +297,29 @@ void hb_set_size( hb_job_t * job, int aspect, int pixels )
else if( aspect > croppedAspect )
{
/* Need to crop on the top and bottom */
- /* TODO */
+ addCrop = croppedHeight - croppedWidth * title->aspect *
+ title->height / aspect / title->width;
+ if( addCrop & 3 )
+ {
+ addCrop = ( addCrop + 1 ) / 2;
+ job->crop[0] += addCrop;
+ job->crop[1] += addCrop;
+ }
+ else if( addCrop & 2 )
+ {
+ addCrop /= 2;
+ job->crop[0] += addCrop - 1;
+ job->crop[1] += addCrop + 1;
+ }
+ else
+ {
+ addCrop /= 2;
+ job->crop[0] += addCrop;
+ job->crop[1] += addCrop;
+ }
}
/* Compute a resolution from the number of pixels and aspect */
- int i, w, h;
for( i = 0;; i++ )
{
w = 16 * i;
diff --git a/libhb/internal.h b/libhb/internal.h
index 7a6caad4a..e13008f9b 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -123,14 +123,6 @@ union hb_esconfig_u
struct
{
- uint8_t sps[HB_CONFIG_MAX_SIZE];
- int sps_length;
- uint8_t pps[HB_CONFIG_MAX_SIZE];
- int pps_length;
- } h264;
-
- struct
- {
uint8_t bytes[HB_CONFIG_MAX_SIZE];
int length;
} aac;
diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c
index 090f332b2..8deba08e3 100644
--- a/libhb/muxcommon.c
+++ b/libhb/muxcommon.c
@@ -70,6 +70,7 @@ static void MuxerFunc( void * _mux )
switch( job->mux )
{
case HB_MUX_MP4:
+ case HB_MUX_PSP:
m = hb_mux_mp4_init( job );
break;
case HB_MUX_AVI:
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index d5002fa4a..21aea7a53 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -4,27 +4,28 @@
Homepage: <http://handbrake.m0k.org/>.
It may be used under the terms of the GNU General Public License. */
-/* libmp4v2 header */
-#include "mp4.h"
+#include <ffmpeg/avformat.h>
#include "hb.h"
+int64_t ff_gcd(int64_t a, int64_t b);
+static inline int ff_get_fourcc(const char *s)
+{
+ return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
+}
+
struct hb_mux_object_s
{
HB_MUX_COMMON;
hb_job_t * job;
- /* libmp4v2 handle */
- MP4FileHandle file;
-
- /* Cumulated durations so far, in timescale units (see MP4Mux) */
- uint64_t sum_dur;
+ AVFormatContext * format;
};
struct hb_mux_data_s
{
- MP4TrackId track;
+ int track;
};
/**********************************************************************
@@ -38,110 +39,141 @@ static int MP4Init( hb_mux_object_t * m )
hb_title_t * title = job->title;
hb_audio_t * audio;
- hb_mux_data_t * mux_data;
int i;
+ AVFormatContext * oc;
+ AVStream *st;
+ AVFormatParameters params;
- /* Create an empty mp4 file */
- m->file = MP4Create( job->file, MP4_DETAILS_ERROR, 0 );
+ register_protocol(&file_protocol);
+ movenc_init();
- /* Video track */
- mux_data = malloc( sizeof( hb_mux_data_t ) );
- job->mux_data = mux_data;
+ oc = av_alloc_format_context();
- /* When using the standard 90000 timescale, QuickTime tends to have
- synchronization issues (audio not playing at the correct speed).
- To workaround this, we use the audio samplerate as the
- timescale */
- MP4SetTimeScale( m->file, job->arate );
-
- if( job->vcodec == HB_VCODEC_X264 )
+ if( job->mux & HB_MUX_PSP )
+ {
+ oc->oformat = guess_format( "psp", NULL, NULL );
+ }
+ else
+ {
+ oc->oformat = guess_format( "mp4", NULL, NULL );
+ }
+ if( !oc->oformat )
{
- /* Stolen from mp4creator */
- MP4SetVideoProfileLevel( m->file, 0x7F );
-
- mux_data->track = MP4AddH264VideoTrack( m->file, job->arate,
- MP4_INVALID_DURATION, job->width, job->height,
- job->config.h264.sps[1], /* AVCProfileIndication */
- job->config.h264.sps[2], /* profile_compat */
- job->config.h264.sps[3], /* AVCLevelIndication */
- 3 ); /* 4 bytes length before each NAL unit */
-
- MP4AddH264SequenceParameterSet( m->file, mux_data->track,
- job->config.h264.sps, job->config.h264.sps_length );
- MP4AddH264PictureParameterSet( m->file, mux_data->track,
- job->config.h264.pps, job->config.h264.pps_length );
+ hb_log( "guess_format failed" );
+ return 1;
}
- else /* FFmpeg or XviD */
+ snprintf( oc->filename, sizeof( oc->filename ),
+ "%s", job->file );
+
+ st = av_new_stream( oc, oc->nb_streams );
+ if( !st )
{
- MP4SetVideoProfileLevel( m->file, MPEG4_SP_L3 );
- mux_data->track = MP4AddVideoTrack( m->file, job->arate,
- MP4_INVALID_DURATION, job->width, job->height,
- MP4_MPEG4_VIDEO_TYPE );
-
- /* VOL from FFmpeg or XviD */
- MP4SetTrackESConfiguration( m->file, mux_data->track,
- job->config.mpeg4.bytes, job->config.mpeg4.length );
+ hb_log( "av_new_stream failed" );
+ return 1;
}
+ st->stream_copy = 1;
+ st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ st->codec->codec_type = CODEC_TYPE_VIDEO;
+ st->codec->codec_id = ( job->vcodec == HB_VCODEC_X264 ) ?
+ CODEC_ID_H264 : CODEC_ID_MPEG4;
+ st->codec->extradata= job->config.mpeg4.bytes;
+ st->codec->extradata_size= job->config.mpeg4.length;
+ st->codec->bit_rate = 1000 * job->vbitrate;
+ i = ff_gcd( job->vrate_base, job->vrate );
+ st->codec->time_base = (AVRational){ job->vrate_base / i, job->vrate / i };
+
+ st->codec->pix_fmt = PIX_FMT_YUV420P;
+ st->codec->width = job->width;
+ st->codec->height = job->height;
+ st->codec->has_b_frames = 0;
+
+ job->mux_data = malloc( sizeof( hb_mux_data_t ) );
+ job->mux_data->track = 0;
for( i = 0; i < hb_list_count( title->list_audio ); i++ )
{
audio = hb_list_item( title->list_audio, i );
- mux_data = malloc( sizeof( hb_mux_data_t ) );
- audio->mux_data = mux_data;
-
- mux_data->track = MP4AddAudioTrack( m->file,
- job->arate, 1024, MP4_MPEG4_AUDIO_TYPE );
- MP4SetAudioProfileLevel( m->file, 0x0F );
- MP4SetTrackESConfiguration( m->file, mux_data->track,
- audio->config.aac.bytes, audio->config.aac.length );
+
+ audio->mux_data = malloc( sizeof( hb_mux_data_t ) );
+ audio->mux_data->track = i + 1;
+
+ st = av_new_stream( oc, oc->nb_streams );
+ if( !st )
+ {
+ hb_log( "av_new_stream failed" );
+ return 1;
+ }
+ st->stream_copy = 1;
+ st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ st->codec->codec_type = CODEC_TYPE_AUDIO;
+ st->codec->codec_id = CODEC_ID_AAC;
+ st->codec->bit_rate = 1000 * job->abitrate;
+ st->codec->extradata= audio->config.aac.bytes;
+ st->codec->extradata_size= audio->config.aac.length;
+ st->codec->time_base = (AVRational){ 1, job->arate };
+ st->codec->channels = 2;
+ st->codec->sample_rate = job->arate;
+ st->codec->frame_size = 1024;
+ st->codec->block_align = 0;
}
+ oc->timestamp = 0;
+ if( url_fopen( &oc->pb, job->file, URL_WRONLY ) < 0 )
+ {
+ hb_log( "url_fopen failed (%s)", job->file );
+ return 1;
+ }
+
+ memset( &params, 0, sizeof( params ) );
+ if( av_set_parameters( oc, &params ) < 0 )
+ {
+ hb_log( "av_set_parameters failed" );
+ return 1;
+ }
+
+ oc->packet_size= 0;
+ oc->mux_rate= 0;
+ oc->preload= (int)(0.5*AV_TIME_BASE);
+ oc->max_delay= (int)(0.7*AV_TIME_BASE);
+ oc->loop_output = AVFMT_NOOUTPUTLOOP;
+
+ if( av_write_header( oc ) < 0 )
+ {
+ hb_log( "av_write_header failed" );
+ return 1;
+ }
+
+ m->format = oc;
+
return 0;
}
static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
hb_buffer_t * buf )
{
- hb_job_t * job = m->job;
+ AVPacket pkt;
+ av_init_packet(&pkt);
- uint64_t duration;
+ pkt.stream_index = mux_data->track;
+ pkt.data = buf->data;
+ pkt.size = buf->size;
+ pkt.pts = buf->start;
- if( mux_data == job->mux_data )
- {
- /* Video */
- /* Because we use the audio samplerate as the timescale,
- we have to use potentially variable durations so the video
- doesn't go out of sync */
- duration = ( buf->stop * job->arate / 90000 ) - m->sum_dur;
- m->sum_dur += duration;
- }
- else
+ if( buf->key )
{
- /* Audio */
- duration = MP4_INVALID_DURATION;
+ pkt.flags |= PKT_FLAG_KEY;
}
- MP4WriteSample( m->file, mux_data->track, buf->data, buf->size,
- duration, 0, buf->key );
+ av_interleaved_write_frame( m->format, &pkt );
+
return 0;
}
static int MP4End( hb_mux_object_t * m )
{
-#if 0
- hb_job_t * job = m->job;
-#endif
- char filename[1024]; memset( filename, 0, 1024 );
-
- MP4Close( m->file );
-
-#if 0
- hb_log( "muxmp4: optimizing file" );
- snprintf( filename, 1024, "%s.tmp", job->file );
- MP4Optimize( job->file, filename, MP4_DETAILS_ERROR );
- remove( job->file );
- rename( filename, job->file );
-#endif
+ av_write_trailer( m->format );
+ url_fclose( &m->format->pb );
+ av_free( m->format );
return 0;
}
diff --git a/libhb/work.c b/libhb/work.c
index 2ad4f65f7..349a630e3 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -71,6 +71,7 @@ static void do_job( hb_job_t * job, int cpu_count )
hb_work_object_t * w;
hb_audio_t * audio;
hb_subtitle_t * subtitle;
+ int done;
title = job->title;
@@ -229,7 +230,7 @@ static void do_job( hb_job_t * job, int cpu_count )
HB_LOW_PRIORITY );
}
- int done = 0;
+ done = 0;
w = hb_list_item( job->list_work, 0 );
w->init( w, job );
while( !*job->die )
diff --git a/macosx/English.lproj/Express.nib/info.nib b/macosx/English.lproj/Express.nib/info.nib
index b7418f0ef..ae8fc644e 100644
--- a/macosx/English.lproj/Express.nib/info.nib
+++ b/macosx/English.lproj/Express.nib/info.nib
@@ -9,7 +9,7 @@
<key>248</key>
<string>487 424 408 321 0 0 1440 878 </string>
<key>259</key>
- <string>417 300 408 508 0 0 1280 832 </string>
+ <string>487 331 408 508 0 0 1440 878 </string>
<key>29</key>
<string>33 298 338 44 0 0 1280 832 </string>
<key>303</key>
@@ -18,6 +18,6 @@
<key>IBFramework Version</key>
<string>443.0</string>
<key>IBSystem Version</key>
- <string>8H14</string>
+ <string>8G1454</string>
</dict>
</plist>
diff --git a/macosx/English.lproj/Express.nib/keyedobjects.nib b/macosx/English.lproj/Express.nib/keyedobjects.nib
index 34bee0b64..960c3e022 100644
--- a/macosx/English.lproj/Express.nib/keyedobjects.nib
+++ b/macosx/English.lproj/Express.nib/keyedobjects.nib
Binary files differ
diff --git a/macosx/ExpressController.m b/macosx/ExpressController.m
index b78bdf8b5..2ffddf56e 100644
--- a/macosx/ExpressController.m
+++ b/macosx/ExpressController.m
@@ -200,27 +200,43 @@
hb_job_t * job = title->job;
int pixels, aspect;
- if( [fConvertFormatPopUp indexOfSelectedItem] )
+ if( [fConvertFormatPopUp indexOfSelectedItem] == 0 )
{
+ /* iPod / H.264 */
+ job->mux = HB_MUX_MP4;
+ job->vcodec = HB_VCODEC_X264;
+ job->h264_13 = 1;
+ job->vbitrate = 600;
+ pixels = 76800;
+ aspect = 4 * HB_ASPECT_BASE / 3;
+ }
+ else if( [fConvertFormatPopUp indexOfSelectedItem] == 1 )
+ {
+ /* iPod / MPEG-4 */
+ job->mux = HB_MUX_MP4;
job->vcodec = HB_VCODEC_FFMPEG;
job->vbitrate = 1200;
pixels = 230400;
+ aspect = 4 * HB_ASPECT_BASE / 3;
}
else
{
- job->vcodec = HB_VCODEC_X264;
- job->h264_13 = 1;
- job->vbitrate = 600;
- pixels = 76800;
+ /* PSP / MPEG-4 */
+ job->mux = HB_MUX_PSP;
+ job->vrate = 27000000;
+ job->vrate_base = 900900; /* 29.97 fps */
+ job->vcodec = HB_VCODEC_FFMPEG;
+ job->vbitrate = 600;
+ pixels = 76800;
+ job->arate = 24000;
+ job->abitrate = 96;
+ aspect = 16 * HB_ASPECT_BASE / 9;
+
}
if( [fConvertAspectPopUp indexOfSelectedItem] )
{
aspect = -1;
}
- else
- {
- aspect = 4 * HB_ASPECT_BASE / 3;
- }
hb_set_size( job, aspect, pixels );
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index de5348438..e9eeb94d7 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
+ 4D1125D809D72FD200E0657B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1125D709D72FD200E0657B /* libz.dylib */; };
+ 4D1125D909D72FD200E0657B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1125D709D72FD200E0657B /* libz.dylib */; };
4D1EA2EA0993B09A00FDC1A2 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; };
4D1EA2F60993B0CA00FDC1A2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
4D1EA3010993B13700FDC1A2 /* Express.nib in Resources */ = {isa = PBXBuildFile; fileRef = 4D1EA3000993B13700FDC1A2 /* Express.nib */; };
@@ -73,6 +75,7 @@
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 4D1125D709D72FD200E0657B /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
4D118405053054CD00C39CA9 /* HandBrake.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = HandBrake.icns; sourceTree = "<group>"; };
4D1EA2DA0993B01000FDC1A2 /* HandBrake Express.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HandBrake Express.app"; sourceTree = BUILT_PRODUCTS_DIR; };
4D1EA2DC0993B01000FDC1A2 /* Express.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Express.plist; sourceTree = "<group>"; };
@@ -108,6 +111,7 @@
files = (
4D1EA2F60993B0CA00FDC1A2 /* Cocoa.framework in Frameworks */,
4D2AEA1A09CCB332007E18F6 /* IOKit.framework in Frameworks */,
+ 4D1125D909D72FD200E0657B /* libz.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -118,6 +122,7 @@
4DD93FA2082036E8008E1322 /* Cocoa.framework in Frameworks */,
4DD93FA3082036E8008E1322 /* IOKit.framework in Frameworks */,
4DD93FA4082036E8008E1322 /* OpenGL.framework in Frameworks */,
+ 4D1125D809D72FD200E0657B /* libz.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -194,6 +199,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 4D1125D709D72FD200E0657B /* libz.dylib */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
4DEB2024052B055F00C39CA9 /* IOKit.framework */,
4DDE9724052B7B2B00C39CA9 /* OpenGL.framework */,
@@ -305,13 +311,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -448,13 +454,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -485,13 +491,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -520,13 +526,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -560,13 +566,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -602,13 +608,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,
@@ -642,13 +648,13 @@
OTHER_LDFLAGS = (
../libhb/libhb.a,
../contrib/lib/liba52.a,
+ ../contrib/lib/libavformat.a,
../contrib/lib/libavcodec.a,
../contrib/lib/libavutil.a,
../contrib/lib/libdvdread.a,
../contrib/lib/libdvdcss.a,
../contrib/lib/libfaac.a,
../contrib/lib/libmp3lame.a,
- ../contrib/lib/libmp4v2.a,
../contrib/lib/libmpeg2.a,
../contrib/lib/libvorbis.a,
../contrib/lib/libvorbisenc.a,