diff options
author | jstebbins <[email protected]> | 2014-01-13 18:43:07 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-01-13 18:43:07 +0000 |
commit | 1d137b47c62a47a4a08f13fc2bd8207633464fd5 (patch) | |
tree | bb7c5c62e67d079a4c66220f25a0c6df3e2438af | |
parent | cd00b6f50ede70a9edef1785dd8c74e1d3ab4dad (diff) |
remove contrib mpeg2dec
We no longer need mpeg2dec. libav now has all the features we need
for mpeg2 decoding.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5966 b64f7644-9d1e-0410-96f1-a4d463321fa5
30 files changed, 20 insertions, 1355 deletions
diff --git a/contrib/mpeg2dec/A00-tags.patch b/contrib/mpeg2dec/A00-tags.patch deleted file mode 100644 index 0b5d7d7da..000000000 --- a/contrib/mpeg2dec/A00-tags.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -ru mpeg2dec.orig/libmpeg2/decode.c mpeg2dec/libmpeg2/decode.c ---- mpeg2dec.orig/libmpeg2/decode.c 2008-07-09 12:16:05.000000000 -0700 -+++ mpeg2dec/libmpeg2/decode.c 2009-07-03 16:29:48.000000000 -0700 -@@ -212,7 +212,7 @@ - - mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec) - { -- static int (* process_header[]) (mpeg2dec_t * mpeg2dec) = { -+ static int (* process_header[]) (mpeg2dec_t *) = { - mpeg2_header_picture, mpeg2_header_extension, mpeg2_header_user_data, - mpeg2_header_sequence, NULL, NULL, NULL, NULL, mpeg2_header_gop - }; -@@ -368,6 +368,14 @@ - - void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2) - { -+ if (mpeg2dec->num_tags == 0 && mpeg2dec->state == STATE_PICTURE && mpeg2dec->picture) { -+ // since tags got processed when we entered this state we -+ // have to set them directly or they'll end up on the next frame. -+ mpeg2dec->picture->tag = tag; -+ mpeg2dec->picture->tag2 = tag2; -+ mpeg2dec->picture->flags |= PIC_FLAG_TAGS; -+ return; -+ } - mpeg2dec->tag_previous = mpeg2dec->tag_current; - mpeg2dec->tag2_previous = mpeg2dec->tag2_current; - mpeg2dec->tag_current = tag; diff --git a/contrib/mpeg2dec/A01-gcc4.6.patch b/contrib/mpeg2dec/A01-gcc4.6.patch deleted file mode 100644 index 8d5fa35d0..000000000 --- a/contrib/mpeg2dec/A01-gcc4.6.patch +++ /dev/null @@ -1,122 +0,0 @@ -Index: libmpeg2/idct_mmx.c -=================================================================== ---- mpeg2dec.orig/libmpeg2/idct_mmx.c (revision 1205) -+++ mpeg2dec/libmpeg2/idct_mmx.c (working copy) -@@ -464,10 +464,10 @@ - /* Almost identical to mmxext version: */ - /* just do both 4x8 columns in paraller */ - -- static const short t1_vector[] ATTR_ALIGN(16) = {T1,T1,T1,T1,T1,T1,T1,T1}; -- static const short t2_vector[] ATTR_ALIGN(16) = {T2,T2,T2,T2,T2,T2,T2,T2}; -- static const short t3_vector[] ATTR_ALIGN(16) = {T3,T3,T3,T3,T3,T3,T3,T3}; -- static const short c4_vector[] ATTR_ALIGN(16) = {C4,C4,C4,C4,C4,C4,C4,C4}; -+ static short t1_vector[] ATTR_ALIGN(16) = {T1,T1,T1,T1,T1,T1,T1,T1}; -+ static short t2_vector[] ATTR_ALIGN(16) = {T2,T2,T2,T2,T2,T2,T2,T2}; -+ static short t3_vector[] ATTR_ALIGN(16) = {T3,T3,T3,T3,T3,T3,T3,T3}; -+ static short c4_vector[] ATTR_ALIGN(16) = {C4,C4,C4,C4,C4,C4,C4,C4}; - - #if defined(__x86_64__) - -@@ -710,10 +710,10 @@ - /* MMX column IDCT */ - static inline void idct_col (int16_t * const col, const int offset) - { -- static const short t1_vector[] ATTR_ALIGN(8) = {T1,T1,T1,T1}; -- static const short t2_vector[] ATTR_ALIGN(8) = {T2,T2,T2,T2}; -- static const short t3_vector[] ATTR_ALIGN(8) = {T3,T3,T3,T3}; -- static const short c4_vector[] ATTR_ALIGN(8) = {C4,C4,C4,C4}; -+ static short t1_vector[] ATTR_ALIGN(8) = {T1,T1,T1,T1}; -+ static short t2_vector[] ATTR_ALIGN(8) = {T2,T2,T2,T2}; -+ static short t3_vector[] ATTR_ALIGN(8) = {T3,T3,T3,T3}; -+ static short c4_vector[] ATTR_ALIGN(8) = {C4,C4,C4,C4}; - - /* column code adapted from peter gubanov */ - /* http://www.elecard.com/peter/idct.shtml */ -@@ -847,33 +847,33 @@ - } - - --static const int32_t rounder0[] ATTR_ALIGN(8) = -+static int32_t rounder0[] ATTR_ALIGN(8) = - rounder ((1 << (COL_SHIFT - 1)) - 0.5); --static const int32_t rounder4[] ATTR_ALIGN(8) = rounder (0); --static const int32_t rounder1[] ATTR_ALIGN(8) = -+static int32_t rounder4[] ATTR_ALIGN(8) = rounder (0); -+static int32_t rounder1[] ATTR_ALIGN(8) = - rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */ --static const int32_t rounder7[] ATTR_ALIGN(8) = -+static int32_t rounder7[] ATTR_ALIGN(8) = - rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */ --static const int32_t rounder2[] ATTR_ALIGN(8) = -+static int32_t rounder2[] ATTR_ALIGN(8) = - rounder (0.60355339059); /* C2 * (C6+C2)/2 */ --static const int32_t rounder6[] ATTR_ALIGN(8) = -+static int32_t rounder6[] ATTR_ALIGN(8) = - rounder (-0.25); /* C2 * (C6-C2)/2 */ --static const int32_t rounder3[] ATTR_ALIGN(8) = -+static int32_t rounder3[] ATTR_ALIGN(8) = - rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */ --static const int32_t rounder5[] ATTR_ALIGN(8) = -+static int32_t rounder5[] ATTR_ALIGN(8) = - rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */ - - - #define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \ - static inline void idct (int16_t * const block) \ - { \ -- static const int16_t table04[] ATTR_ALIGN(16) = \ -+ static int16_t table04[] ATTR_ALIGN(16) = \ - table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \ -- static const int16_t table17[] ATTR_ALIGN(16) = \ -+ static int16_t table17[] ATTR_ALIGN(16) = \ - table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \ -- static const int16_t table26[] ATTR_ALIGN(16) = \ -+ static int16_t table26[] ATTR_ALIGN(16) = \ - table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \ -- static const int16_t table35[] ATTR_ALIGN(16) = \ -+ static int16_t table35[] ATTR_ALIGN(16) = \ - table (26722, 25172, 22654, 19266, 15137, 10426, 5315); \ - \ - idct_row_head (block, 0*8, table04); \ -@@ -900,29 +900,29 @@ - - static inline void sse2_idct (int16_t * const block) - { -- static const int16_t table04[] ATTR_ALIGN(16) = -+ static int16_t table04[] ATTR_ALIGN(16) = - sse2_table (22725, 21407, 19266, 16384, 12873, 8867, 4520); -- static const int16_t table17[] ATTR_ALIGN(16) = -+ static int16_t table17[] ATTR_ALIGN(16) = - sse2_table (31521, 29692, 26722, 22725, 17855, 12299, 6270); -- static const int16_t table26[] ATTR_ALIGN(16) = -+ static int16_t table26[] ATTR_ALIGN(16) = - sse2_table (29692, 27969, 25172, 21407, 16819, 11585, 5906); -- static const int16_t table35[] ATTR_ALIGN(16) = -+ static int16_t table35[] ATTR_ALIGN(16) = - sse2_table (26722, 25172, 22654, 19266, 15137, 10426, 5315); - -- static const int32_t rounder0_128[] ATTR_ALIGN(16) = -+ static int32_t rounder0_128[] ATTR_ALIGN(16) = - rounder_sse2 ((1 << (COL_SHIFT - 1)) - 0.5); -- static const int32_t rounder4_128[] ATTR_ALIGN(16) = rounder_sse2 (0); -- static const int32_t rounder1_128[] ATTR_ALIGN(16) = -+ static int32_t rounder4_128[] ATTR_ALIGN(16) = rounder_sse2 (0); -+ static int32_t rounder1_128[] ATTR_ALIGN(16) = - rounder_sse2 (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */ -- static const int32_t rounder7_128[] ATTR_ALIGN(16) = -+ static int32_t rounder7_128[] ATTR_ALIGN(16) = - rounder_sse2 (-0.25); /* C1*(C7/C4+C7-C1)/2 */ -- static const int32_t rounder2_128[] ATTR_ALIGN(16) = -+ static int32_t rounder2_128[] ATTR_ALIGN(16) = - rounder_sse2 (0.60355339059); /* C2 * (C6+C2)/2 */ -- static const int32_t rounder6_128[] ATTR_ALIGN(16) = -+ static int32_t rounder6_128[] ATTR_ALIGN(16) = - rounder_sse2 (-0.25); /* C2 * (C6-C2)/2 */ -- static const int32_t rounder3_128[] ATTR_ALIGN(16) = -+ static int32_t rounder3_128[] ATTR_ALIGN(16) = - rounder_sse2 (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */ -- static const int32_t rounder5_128[] ATTR_ALIGN(16) = -+ static int32_t rounder5_128[] ATTR_ALIGN(16) = - rounder_sse2 (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */ - - #if defined(__x86_64__) diff --git a/contrib/mpeg2dec/A02-gwluserdata.patch b/contrib/mpeg2dec/A02-gwluserdata.patch deleted file mode 100644 index 385a4ef73..000000000 --- a/contrib/mpeg2dec/A02-gwluserdata.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -ru mpeg2dec.orig/libvo/video_out_dx.c mpeg2dec/libvo/video_out_dx.c ---- mpeg2dec.orig/libvo/video_out_dx.c 2008-07-09 11:28:24.000000000 -0700 -+++ mpeg2dec/libvo/video_out_dx.c 2012-09-08 05:31:39.304849824 -0700 -@@ -92,9 +92,9 @@ - switch (message) { - - case WM_WINDOWPOSCHANGED: -- instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); -+ /*instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); - -- /* update the window position and size */ -+ // update the window position and size - point_window.x = 0; - point_window.y = 0; - ClientToScreen (hwnd, &point_window); -@@ -104,9 +104,9 @@ - instance->window_coords.right = rect_window.right + point_window.x; - instance->window_coords.bottom = rect_window.bottom + point_window.y; - -- /* update the overlay */ -+ // update the overlay - if (instance->overlay && instance->display) -- update_overlay (instance); -+ update_overlay (instance);*/ - - return 0; - -@@ -173,7 +173,10 @@ - /* store a directx_instance pointer into the window local storage - * (for later use in event_handler). - * We need to use SetWindowLongPtr when it is available in mingw */ -- SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); -+ -+ // Current version of MINGW-W64 does not have this! -+ // Since we are not outputting to a display, this is not a problem. -+ //SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); - - ShowWindow (instance->window, SW_SHOW); - diff --git a/contrib/mpeg2dec/A03-modern-gcc-cflags.patch b/contrib/mpeg2dec/A03-modern-gcc-cflags.patch deleted file mode 100644 index 288a62377..000000000 --- a/contrib/mpeg2dec/A03-modern-gcc-cflags.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- mpeg2dec/configure.bak Fri Jul 18 10:41:54 2008 -+++ mpeg2dec/configure Wed Nov 27 23:04:30 2013 -@@ -4614,7 +4614,7 @@ - elif test x"$GCC" = x"yes"; then - - -- TRY_CFLAGS="$OPT_CFLAGS -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" -+ TRY_CFLAGS="$OPT_CFLAGS -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" - { echo "$as_me:$LINENO: checking if $CC supports $TRY_CFLAGS $CFLAGS flags" >&5 - echo $ECHO_N "checking if $CC supports $TRY_CFLAGS $CFLAGS flags... $ECHO_C" >&6; } - SAVE_CFLAGS="$CFLAGS" -@@ -4859,11 +4859,11 @@ - _ACEOF - - case "$host" in -- i386-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i386";; -- i486-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=i486";; -- i586-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentium";; -- i686-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=pentiumpro";; -- k6-*) TRY_CFLAGS="$OPT_CFLAGS -mcpu=k6";; -+ i386-*) TRY_CFLAGS="$OPT_CFLAGS -mtune=i386";; -+ i486-*) TRY_CFLAGS="$OPT_CFLAGS -mtune=i486";; -+ i586-*) TRY_CFLAGS="$OPT_CFLAGS -mtune=pentium";; -+ i686-*) TRY_CFLAGS="$OPT_CFLAGS -mtune=pentiumpro";; -+ k6-*) TRY_CFLAGS="$OPT_CFLAGS -mtune=k6";; - esac - { echo "$as_me:$LINENO: checking if $CC supports $TRY_CFLAGS $CFLAGS flags" >&5 - echo $ECHO_N "checking if $CC supports $TRY_CFLAGS $CFLAGS flags... $ECHO_C" >&6; } -@@ -5084,7 +5084,7 @@ - #define ARCH_SPARC - _ACEOF - -- TRY_CFLAGS="$OPT_CFLAGS -mcpu=ultrasparc -mvis" -+ TRY_CFLAGS="$OPT_CFLAGS -mtune=ultrasparc -mvis" - { echo "$as_me:$LINENO: checking if $CC supports $TRY_CFLAGS $CFLAGS flags" >&5 - echo $ECHO_N "checking if $CC supports $TRY_CFLAGS $CFLAGS flags... $ECHO_C" >&6; } - SAVE_CFLAGS="$CFLAGS" diff --git a/contrib/mpeg2dec/P00-mingw-disable-sse.patch b/contrib/mpeg2dec/P00-mingw-disable-sse.patch deleted file mode 100644 index ee23632b9..000000000 --- a/contrib/mpeg2dec/P00-mingw-disable-sse.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: libmpeg2/cpu_accel.c -=================================================================== ---- mpeg2dec/libmpeg2/cpu_accel.c (revision 1205) -+++ mpeg2dec/libmpeg2/cpu_accel.c (working copy) -@@ -111,7 +111,13 @@ - - cpuid (0x80000000, eax, ebx, ecx, edx); - if (eax < 0x80000001) /* no extended capabilities */ -- return accel; -+ { -+#if defined(__x86_64__) -+ // SSE code is broken on mingw64, so disable it. -+ accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3); -+#endif -+ return accel; -+ } - - cpuid (0x80000001, eax, ebx, ecx, edx); - -@@ -120,6 +126,10 @@ - - if (AMD && (edx & 0x00400000)) /* AMD MMX extensions */ - accel |= MPEG2_ACCEL_X86_MMXEXT; -+#if defined(__x86_64__) -+ // SSE code is broken on mingw64, so disable it. -+ accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3); -+#endif - } - #endif /* ACCEL_DETECT */ - diff --git a/contrib/mpeg2dec/P01-darwin-configure-inline.patch b/contrib/mpeg2dec/P01-darwin-configure-inline.patch deleted file mode 100644 index d244f1416..000000000 --- a/contrib/mpeg2dec/P01-darwin-configure-inline.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git mpeg2dec/configure.ac mpeg2dec/configure.ac -index 9f4831e..fd4196f 100644 ---- mpeg2dec/configure.ac -+++ mpeg2dec/configure.ac -@@ -142,7 +142,6 @@ AC_CHECK_GENERATE_INTTYPES([include]) - - dnl Checks for typedefs, structures, and compiler characteristics. - AC_C_CONST --AC_C_ALWAYS_INLINE - AC_C_RESTRICT - AC_C_BUILTIN_EXPECT - AC_C_BIGENDIAN diff --git a/contrib/mpeg2dec/module.defs b/contrib/mpeg2dec/module.defs deleted file mode 100644 index 5fcf8e184..000000000 --- a/contrib/mpeg2dec/module.defs +++ /dev/null @@ -1,17 +0,0 @@ -$(eval $(call import.MODULE.defs,MPEG2DEC,mpeg2dec)) -$(eval $(call import.CONTRIB.defs,MPEG2DEC)) - -MPEG2DEC.FETCH.url = http://download.handbrake.fr/handbrake/contrib/mpeg2dec-0.5.1.tar.gz -MPEG2DEC.EXTRACT.tarbase = mpeg2dec - -ifeq (darwin,$(BUILD.system)) - # darwin configure patch needs autoreconf - MPEG2DEC.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; autoreconf -fiv; -endif - -MPEG2DEC.CONFIGURE.extra = --disable-sdl --without-x - -# this contrib will not build under MinGW with -std=gnu99 -ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system)) - MPEG2DEC.GCC.args.c_std = -endif diff --git a/contrib/mpeg2dec/module.rules b/contrib/mpeg2dec/module.rules deleted file mode 100644 index 78ce10aca..000000000 --- a/contrib/mpeg2dec/module.rules +++ /dev/null @@ -1,2 +0,0 @@ -$(eval $(call import.MODULE.rules,MPEG2DEC)) -$(eval $(call import.CONTRIB.rules,MPEG2DEC)) diff --git a/gtk/configure.ac b/gtk/configure.ac index 4624d3ec5..5ca4b3eaf 100644 --- a/gtk/configure.ac +++ b/gtk/configure.ac @@ -215,7 +215,7 @@ case $host in ;; esac -HB_LIBS="-lhb -la52 -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2" +HB_LIBS="-lhb -la52 -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2" if test "x$use_fdk_aac" = "xyes" ; then HB_LIBS+=" -lfdk-aac" diff --git a/libhb/bd.c b/libhb/bd.c index 7d2bab390..356e14bee 100644 --- a/libhb/bd.c +++ b/libhb/bd.c @@ -340,7 +340,8 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration ) { case BLURAY_STREAM_TYPE_VIDEO_MPEG1: case BLURAY_STREAM_TYPE_VIDEO_MPEG2: - title->video_codec = WORK_DECMPEG2; + title->video_codec = WORK_DECAVCODECV; + title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO; title->video_codec_param = 0; break; diff --git a/libhb/common.c b/libhb/common.c index 720770a5d..a0e6b7a58 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -2808,7 +2808,8 @@ hb_title_t * hb_title_init( char * path, int index ) strcat( t->path, path ); // default to decoding mpeg2 t->video_id = 0xE0; - t->video_codec = WORK_DECMPEG2; + t->video_codec = WORK_DECAVCODECV; + t->video_codec_param = AV_CODEC_ID_MPEG2VIDEO; t->angle_count = 1; t->pixel_aspect_width = 1; t->pixel_aspect_height = 1; diff --git a/libhb/common.h b/libhb/common.h index a76e51e55..613338b35 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -1061,7 +1061,6 @@ struct hb_work_object_s extern hb_work_object_t hb_sync_video; extern hb_work_object_t hb_sync_audio; -extern hb_work_object_t hb_decmpeg2; extern hb_work_object_t hb_decvobsub; extern hb_work_object_t hb_encvobsub; extern hb_work_object_t hb_deccc608; diff --git a/libhb/deblock.c b/libhb/deblock.c index dab622abc..1d50fc552 100644 --- a/libhb/deblock.c +++ b/libhb/deblock.c @@ -18,7 +18,6 @@ #include "hb.h" #include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" #define PP7_QP_DEFAULT 5 #define PP7_MODE_DEFAULT 2 diff --git a/libhb/decmpeg2.c b/libhb/decmpeg2.c deleted file mode 100644 index 9d6b8fe42..000000000 --- a/libhb/decmpeg2.c +++ /dev/null @@ -1,1013 +0,0 @@ -/* decmpeg2.c - - Copyright (c) 2003-2013 HandBrake Team - This file is part of the HandBrake source code - Homepage: <http://handbrake.fr/>. - It may be used under the terms of the GNU General Public License v2. - For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html - */ - -#include "hb.h" -#include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" - -/* Cadence tracking */ -#ifndef PIC_FLAG_REPEAT_FIRST_FIELD -#define PIC_FLAG_REPEAT_FIRST_FIELD 256 -#endif -#define TOP_FIRST PIC_FLAG_TOP_FIELD_FIRST -#define PROGRESSIVE PIC_FLAG_PROGRESSIVE_FRAME -#define COMPOSITE PIC_FLAG_COMPOSITE_DISPLAY -#define SKIP PIC_FLAG_SKIP -#define TAGS PIC_FLAG_TAGS -#define REPEAT_FIRST PIC_FLAG_REPEAT_FIRST_FIELD -#define COMPOSITE_MASK PIC_MASK_COMPOSITE_DISPLAY -#define TB 8 -#define BT 16 -#define BT_PROG 32 -#define BTB_PROG 64 -#define TB_PROG 128 -#define TBT_PROG 256 - -#define NTAGS 8 - -/********************************************************************** - * hb_libmpeg2_t - *********************************************************************/ -typedef struct hb_libmpeg2_s -{ - mpeg2dec_t * libmpeg2; - const mpeg2_info_t * info; - hb_job_t * job; - hb_title_t * title; - int width; - int height; - int rate; - double aspect_ratio; - enum AVPixelFormat pixfmt; - int got_iframe; /* set when we get our first iframe */ - int look_for_iframe; /* need an iframe to add chap break */ - int look_for_break; /* need gop start to add chap break */ - int cur_tag; /* index of current tag */ - uint32_t nframes; /* number of frames we've decoded */ - int64_t last_pts; - int64_t first_pts; - int cadence[12]; - int flag; - hb_list_t * list_subtitle; - hb_buffer_t * last_cc1_buf; - struct { - int64_t start; // start time of this frame - hb_buffer_t * cc_buf; // captions for this frame - } tags[NTAGS]; - uint8_t cc_tag_pending; - - struct SwsContext *sws_context; // if we have to rescale or convert color space - int sws_width; - int sws_height; - int sws_pix_fmt; -} hb_libmpeg2_t; - -/********************************************************************** - * hb_libmpeg2_init - ********************************************************************** - * - *********************************************************************/ -static hb_libmpeg2_t * hb_libmpeg2_init() -{ - hb_libmpeg2_t * m = calloc( sizeof( hb_libmpeg2_t ), 1 ); - - m->libmpeg2 = mpeg2_init(); - m->info = mpeg2_info( m->libmpeg2 ); - m->last_pts = -1; - m->first_pts = -1; - - int i; - for ( i = 0; i < NTAGS; ++i ) - { - m->tags[i].start = -2; - } - - return m; -} - -// send cc_buf to the CC decoder(s) -static void cc_send_to_decoder( hb_libmpeg2_t *m, hb_buffer_t *cc_buf ) -{ - hb_subtitle_t *subtitle; - - // if there's more than one decoder for the captions send a copy - // of the buffer to all but the last. Then send the buffer to - // the last one (usually there's just one decoder so the 'while' is skipped). - int i = 0, n = hb_list_count( m->list_subtitle ); - while ( --n > 0 ) - { - // make a copy of the buf then forward it to the decoder - hb_buffer_t *cpy = hb_buffer_init( cc_buf->size ); - cpy->s = cc_buf->s; - memcpy( cpy->data, cc_buf->data, cc_buf->size ); - - subtitle = hb_list_item( m->list_subtitle, i++ ); - hb_fifo_push( subtitle->fifo_in, cpy ); - } - subtitle = hb_list_item( m->list_subtitle, i ); - hb_fifo_push( subtitle->fifo_in, cc_buf ); -} - -static void hb_mpeg2_cc( hb_libmpeg2_t *m, const uint8_t *cc_block ) -{ - uint8_t cc_hdr = *cc_block; - - if ( ( cc_hdr & 0x4 ) == 0 ) - // not valid - ignore - return; - - switch (cc_hdr & 3) - { - case 0: - // CC1 stream - if ( ( cc_block[1] & 0x7f ) == 0 && ( cc_block[2] & 0x7f ) == 0 ) - // just padding - ignore - return; - - if ( m->last_cc1_buf ) - { - // new data from the same time as last call - add to buffer - int len = m->last_cc1_buf->size; - hb_buffer_realloc( m->last_cc1_buf, len + 2 ); - memcpy( m->last_cc1_buf->data + len, cc_block+1, 2 ); - m->last_cc1_buf->size = len + 2; - return; - } - - // allocate a new buffer and copy the caption data into it. - // (we don't send it yet because we don't know what timestamp to use). - hb_buffer_t *cc_buf = hb_buffer_init( 2 ); - if( !cc_buf ) - return; - - memcpy( cc_buf->data, cc_block+1, 2 ); - m->last_cc1_buf = cc_buf; - break; -#ifdef notyet - case 1: - // CC2 stream - //process608( cc_block+1, 2, &m->cc608 ); - break; - case 2: //EIA-708 - // DTVCC packet data - // Fall through - case 3: //EIA-708 - { - uint8_t temp[4]; - temp[0]=cc_valid; - temp[1]=cc_type; - temp[2]=cc_block[1]; - temp[3]=cc_block[2]; - do_708 ((const unsigned char *) temp, 4); - } - break; -#endif - default: - break; - } -} - -static inline int have_captions( const uint8_t *user_data, uint32_t len ) -{ - return len >= 6 && - ( ( user_data[0] == 0x43 && user_data[1] == 0x43 ) || - ( user_data[0] == 0x47 && user_data[1] == 0x41 && - user_data[2] == 0x39 && user_data[3] == 0x34 && - user_data[4] == 3 && (user_data[5] & 0x40) ) ); -} - -static void do_one_dvd_cc( hb_libmpeg2_t *m, const uint8_t *header, int field1 ) -{ - uint8_t data[3]; - - data[0] = ( header[0] == 0xff && 0 == field1 )? 0x04 : 0x05; - data[1] = header[1]; - data[2] = header[2]; - hb_mpeg2_cc( m, data ); - - data[0] = ( header[3] == 0xff && 1 == field1 )? 0x04 : 0x05; - data[1] = header[4]; - data[2] = header[5]; - hb_mpeg2_cc( m, data ); -} - -// extract all the captions in the current frame and send them downstream -// to the decoder. -// -// (this routine should only be called if there are captions in the current -// frame. I.e., only if a call to 'have_captions' returns true.) -static void extract_mpeg2_captions( hb_libmpeg2_t *m ) -{ - const uint8_t *user_data = m->info->user_data; - int dvd_captions = user_data[0] == 0x43; - int capcount, field1packet = 0; - const uint8_t *header = &user_data[4]; - if ( !dvd_captions ) - { - // ATSC encapsulated captions - header starts one byte later - // and has an extra unused byte following it. - capcount = header[1] & 0x1f; - header += 3; - } - else - { - // DVD captions - if ( ( header[0] & 0x80 ) == 0x00 ) - field1packet=1; /* expect Field 1 second */ - capcount=(header[0] & 0x1e) / 2; - header++; - } - - int i; - for( i=0; i<capcount; i++ ) - { - if ( !dvd_captions ) - { - hb_mpeg2_cc( m, header ); - header += 3; - } - else - { - do_one_dvd_cc( m, header, field1packet ); - header += 6; - } - } - if ( dvd_captions ) - { - // Deal with extra closed captions some DVDs have. - while( header[0]==0xfe || header[0]==0xff ) - { - do_one_dvd_cc( m, header, field1packet ); - header += 6; - } - } -} - -static void next_tag( hb_libmpeg2_t *m, hb_buffer_t *buf_es ) -{ - if( m->tags[m->cur_tag].cc_buf == m->last_cc1_buf ) - m->last_cc1_buf = NULL; - - m->cur_tag = ( m->cur_tag + 1 ) & (NTAGS-1); - if ( m->tags[m->cur_tag].start >= 0 || m->tags[m->cur_tag].cc_buf ) - { - if ( m->tags[m->cur_tag].start < 0 || - ( m->got_iframe && m->tags[m->cur_tag].start >= m->first_pts ) ) - hb_log("mpeg2 tag botch: pts %"PRId64", tag pts %"PRId64" buf %p", - buf_es->s.start, m->tags[m->cur_tag].start, m->tags[m->cur_tag].cc_buf); - if ( m->tags[m->cur_tag].cc_buf ) - hb_buffer_close( &m->tags[m->cur_tag].cc_buf ); - } - m->tags[m->cur_tag].start = buf_es->s.start; - mpeg2_tag_picture( m->libmpeg2, m->cur_tag, 0 ); -} - -static hb_buffer_t *hb_copy_frame( hb_libmpeg2_t *m ) -{ - hb_job_t * job = m->job; - int width = m->info->sequence->width; - int height = m->info->sequence->height; - enum AVPixelFormat pixfmt = m->pixfmt; - uint8_t *y = m->info->display_fbuf->buf[0]; - uint8_t *u = m->info->display_fbuf->buf[1]; - uint8_t *v = m->info->display_fbuf->buf[2]; - int crop[4] = {0}; - - int dst_w, dst_h; - int src_w, src_h; - - if ( m->info->sequence->picture_width < m->info->sequence->width ) - { - crop[3] = m->info->sequence->width - m->info->sequence->picture_width; - } - if ( m->info->sequence->picture_height < m->info->sequence->height ) - { - crop[1] = m->info->sequence->height - m->info->sequence->picture_height; - } - - src_w = width - (crop[2] + crop[3]); - src_h = height - (crop[0] + crop[1]); - if ( job ) - { - dst_w = job->title->width; - dst_h = job->title->height; - } - else - { - dst_w = src_w; - dst_h = src_h; - } - - hb_buffer_t *buf = hb_video_buffer_init( dst_w, dst_h ); - buf->s.start = -1; - - AVPicture in, out, pic_crop; - - in.data[0] = y; - in.data[1] = u; - in.data[2] = v; - in.linesize[0] = width; - in.linesize[1] = width>>1; - in.linesize[2] = width>>1; - hb_avpicture_fill( &out, buf ); - - av_picture_crop( &pic_crop, &in, pixfmt, crop[0], crop[2] ); - - if ( !m->sws_context || - m->sws_width != src_w || - m->sws_height != src_h || - m->sws_pix_fmt != pixfmt ) - { - // Source and Dest dimensions may be the same. There is no speed - // cost to using sws_scale to simply copy the data. - m->sws_context = hb_sws_get_context( src_w, src_h, pixfmt, - dst_w, dst_h, buf->f.fmt, - SWS_LANCZOS|SWS_ACCURATE_RND); - m->sws_width = src_w; - m->sws_height = src_h; - m->sws_pix_fmt = pixfmt; - - if ( m->sws_context == NULL ) - { - hb_buffer_close( &buf ); - return NULL; - } - - } - - sws_scale( m->sws_context, (const uint8_t* const *)pic_crop.data, - pic_crop.linesize, 0, src_h, out.data, out.linesize ); - - return buf; -} - -/********************************************************************** - * hb_libmpeg2_decode - ********************************************************************** - * - *********************************************************************/ -static int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es, - hb_list_t * list_raw ) -{ - mpeg2_state_t state; - hb_buffer_t * buf; - - if ( buf_es->size ) - { - /* Feed libmpeg2 */ - if( buf_es->s.start >= 0 ) - { - next_tag( m, buf_es ); - m->cc_tag_pending = 1; - } - mpeg2_buffer( m->libmpeg2, buf_es->data, buf_es->data + buf_es->size ); - } - - for( ;; ) - { - state = mpeg2_parse( m->libmpeg2 ); - if( state == STATE_BUFFER ) - { - /* Require some more data */ - break; - } - - // if the user requested captions, process - // any captions found in the current frame. - if ( m->list_subtitle && m->last_pts >= 0 && - have_captions( m->info->user_data, m->info->user_data_len ) ) - { - extract_mpeg2_captions( m ); - // if we don't have a tag for the captions, make one - if ( m->last_cc1_buf && m->tags[m->cur_tag].cc_buf != m->last_cc1_buf ) - { - // If we have not set a CC tag for the picture and - // we have a new CC buffer, make a new tag. - if (!m->cc_tag_pending && m->tags[m->cur_tag].cc_buf != NULL) - { - next_tag( m, buf_es ); - } - else if (m->tags[m->cur_tag].cc_buf) - { - hb_log("mpeg2 tag botch2: pts %"PRId64", tag pts %"PRId64" buf %p", - buf_es->s.start, m->tags[m->cur_tag].start, m->tags[m->cur_tag].cc_buf); - hb_buffer_close( &m->tags[m->cur_tag].cc_buf ); - } - // see if we already made a tag for the timestamp. If so we - // can just use it, otherwise make a new tag. - if (m->tags[m->cur_tag].start == -2) - { - next_tag( m, buf_es ); - } - m->tags[m->cur_tag].cc_buf = m->last_cc1_buf; - } - } - if( state == STATE_PICTURE ) - { - m->cc_tag_pending = 0; - } - else if( state == STATE_SEQUENCE ) - { - if( !( m->width && m->height && m->rate ) ) - { - m->width = m->info->sequence->picture_width; - m->height = m->info->sequence->picture_height; - m->rate = m->info->sequence->frame_period; - if ( m->aspect_ratio <= 0 && m->height && - m->info->sequence->pixel_height ) - { - /* mpeg2_parse doesn't store the aspect ratio. Instead - * it keeps the pixel width & height that would cause - * the storage width & height to come out in the correct - * aspect ratio. Convert these back to aspect ratio. - */ - double ar_numer = m->width * m->info->sequence->pixel_width; - double ar_denom = m->height * m->info->sequence->pixel_height; - m->aspect_ratio = ar_numer / ar_denom; - } - } - if ( m->info->sequence->width >> 1 == m->info->sequence->chroma_width && - m->info->sequence->height >> 1 == m->info->sequence->chroma_height ) - { - m->pixfmt = AV_PIX_FMT_YUV420P; - } - else - { - m->pixfmt = AV_PIX_FMT_YUV422P; - } - } - else if( state == STATE_GOP && m->look_for_break) - { - // we were looking for a gop to add a chapter break - we found it - // so now start looking for an iframe. - m->look_for_iframe = m->look_for_break; - m->look_for_break = 0; - } - else if( ( state == STATE_SLICE || state == STATE_END ) && - m->info->display_fbuf ) - { - m->last_cc1_buf = NULL; - - if( !m->got_iframe && ( m->info->display_picture->flags & - PIC_MASK_CODING_TYPE ) == PIC_FLAG_CODING_TYPE_I ) - { - // we got an iframe so we can start decoding video now - m->got_iframe = 1; - } - - if( m->got_iframe ) - { - buf = hb_copy_frame( m ); - if ( buf == NULL ) - continue; - - buf->sequence = buf_es->sequence; - - hb_buffer_t *cc_buf = NULL; - if( m->info->display_picture->flags & PIC_FLAG_TAGS ) - { - int t = m->info->display_picture->tag; - buf->s.start = m->tags[t].start; - cc_buf = m->tags[t].cc_buf; - m->tags[t].start = -2; - m->tags[t].cc_buf = NULL; - } - if( buf->s.start < 0 && m->last_pts >= 0 ) - { - /* For some reason nb_fields is sometimes 1 while it - should be 2 */ - buf->s.start = m->last_pts + - MAX( 2, m->info->display_picture->nb_fields ) * - m->info->sequence->frame_period / 600; - } - if ( buf->s.start >= 0 ) - { - m->last_pts = buf->s.start; - } - - // if we were accumulating captions we now know the timestamp - // so ship them to the decoder. - if ( cc_buf ) - { - cc_buf->s.start = m->last_pts; - cc_send_to_decoder( m, cc_buf ); - } - - if( m->look_for_iframe && ( m->info->display_picture->flags & - PIC_MASK_CODING_TYPE ) == PIC_FLAG_CODING_TYPE_I ) - { - // we were waiting for an iframe to insert a chapter mark - // and we have one. - int new_chap = m->look_for_iframe; - buf->s.new_chap = new_chap; - - m->look_for_iframe = 0; - const char *chap_name = ""; - if ( m->job && new_chap > 0 && - hb_list_item( m->job->list_chapter, - new_chap - 1 ) ) - { - hb_chapter_t * c = hb_list_item( - m->job->list_chapter, - new_chap - 1 ); - chap_name = c->title; - } - hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64, - chap_name, new_chap, - m->nframes, buf->s.start ); - } - else if ( m->nframes == 0 ) - { - // this is the first frame returned by the decoder - m->first_pts = buf->s.start; - if ( m->job && hb_list_item( m->job->list_chapter, - m->job->chapter_start - 1 ) ) - { - hb_chapter_t * c = hb_list_item( m->job->list_chapter, - m->job->chapter_start - 1 ); - hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64, - c->title, m->job->chapter_start, m->nframes, buf->s.start ); - } - } - ++m->nframes; - - m->flag = m->info->display_picture->flags; - -/* Uncomment this block to see frame-by-frame picture flags, as the video encodes. - hb_log("***** MPEG 2 Picture Info for PTS %"PRId64" *****", buf->s.start); - if( m->flag & TOP_FIRST ) - hb_log("MPEG2 Flag: Top field first"); - if( m->flag & PROGRESSIVE ) - hb_log("MPEG2 Flag: Progressive"); - if( m->flag & COMPOSITE ) - hb_log("MPEG2 Flag: Composite"); - if( m->flag & SKIP ) - hb_log("MPEG2 Flag: Skip!"); - if( m->flag & TAGS ) - hb_log("MPEG2 Flag: TAGS"); - if(fm->lag & REPEAT_FIRST ) - hb_log("MPEG2 Flag: Repeat first field"); - if( m->flag & COMPOSITE_MASK ) - hb_log("MPEG2 Flag: Composite mask"); - hb_log("fields: %d", m->info->display_picture->nb_fields); -*/ - /* Rotate the cadence tracking. */ - int i = 0; - for(i=11; i > 0; i--) - { - m->cadence[i] = m->cadence[i-1]; - } - - if ( !(m->flag & PROGRESSIVE) && !(m->flag & TOP_FIRST) ) - { - /* Not progressive, not top first... - That means it's probably bottom - first, 2 fields displayed. - */ - //hb_log("MPEG2 Flag: Bottom field first, 2 fields displayed."); - m->cadence[0] = BT; - } - else if ( !(m->flag & PROGRESSIVE) && (m->flag & TOP_FIRST) ) - { - /* Not progressive, top is first, - Two fields displayed. - */ - //hb_log("MPEG2 Flag: Top field first, 2 fields displayed."); - m->cadence[0] = TB; - } - else if ( (m->flag & PROGRESSIVE) && !(m->flag & TOP_FIRST) && !( m->flag & REPEAT_FIRST ) ) - { - /* Progressive, but noting else. - That means Bottom first, - 2 fields displayed. - */ - //hb_log("MPEG2 Flag: Progressive. Bottom field first, 2 fields displayed."); - m->cadence[0] = BT_PROG; - } - else if ( (m->flag & PROGRESSIVE) && !(m->flag & TOP_FIRST) && ( m->flag & REPEAT_FIRST ) ) - { - /* Progressive, and repeat. . - That means Bottom first, - 3 fields displayed. - */ - //hb_log("MPEG2 Flag: Progressive repeat. Bottom field first, 3 fields displayed."); - m->cadence[0] = BTB_PROG; - } - else if ( (m->flag & PROGRESSIVE) && (m->flag & TOP_FIRST) && !( m->flag & REPEAT_FIRST ) ) - { - /* Progressive, top first. - That means top first, - 2 fields displayed. - */ - //hb_log("MPEG2 Flag: Progressive. Top field first, 2 fields displayed."); - m->cadence[0] = TB_PROG; - } - else if ( (m->flag & PROGRESSIVE) && (m->flag & TOP_FIRST) && ( m->flag & REPEAT_FIRST ) ) - { - /* Progressive, top, repeat. - That means top first, - 3 fields displayed. - */ - //hb_log("MPEG2 Flag: Progressive repeat. Top field first, 3 fields displayed."); - m->cadence[0] = TBT_PROG; - } - - if ( (m->cadence[2] <= TB) && (m->cadence[1] <= TB) && (m->cadence[0] > TB) && (m->cadence[11]) ) - hb_log("%fs: Video -> Film", (float)buf->s.start / 90000); - if ( (m->cadence[2] > TB) && (m->cadence[1] <= TB) && (m->cadence[0] <= TB) && (m->cadence[11]) ) - hb_log("%fs: Film -> Video", (float)buf->s.start / 90000); - - buf->s.flags = m->info->display_picture->flags; - - hb_list_add( list_raw, buf ); - } - } - else if( state == STATE_INVALID ) - { - mpeg2_reset( m->libmpeg2, 0 ); - } - - /* - * Add closed captions to the title if we are scanning (no job). - * - * Just because we don't add this doesn't mean that there aren't any when - * we scan, just that noone said anything. So you should be able to add - * closed captions some other way (See decmpeg2Init() for alternative - * approach of assuming that there are always CC, which is probably - * safer - however I want to leave the autodetect in here for now to - * see how it goes). - */ - if( !m->job && m->title && - have_captions( m->info->user_data, m->info->user_data_len ) ) - { - hb_subtitle_t *subtitle; - int i = 0; - - while ( ( subtitle = hb_list_item( m->title->list_subtitle, i++ ) ) ) - { - /* - * Let's call them 608 subs for now even if they aren't, - * since they are the only types we grok. - */ - if( subtitle->source == CC608SUB ) - { - break; - } - } - - if( ! subtitle ) - { - subtitle = calloc( sizeof( hb_subtitle_t ), 1 ); - subtitle->track = 0; - subtitle->id = 0; - subtitle->format = TEXTSUB; - subtitle->source = CC608SUB; - subtitle->config.dest = PASSTHRUSUB; - subtitle->codec = WORK_DECCC608; - subtitle->type = 5; - snprintf( subtitle->lang, sizeof( subtitle->lang ), "Closed Captions"); - /* - * The language of the subtitles will be the same as the first audio - * track, i.e. the same as the video. - */ - hb_audio_t *audio = hb_list_item( m->title->list_audio, 0 ); - if( audio ) - { - snprintf( subtitle->iso639_2, sizeof( subtitle->iso639_2 ), - "%s", audio->config.lang.iso639_2); - } else { - snprintf( subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "und"); - } - hb_list_add( m->title->list_subtitle, subtitle ); - } - } - } - return 1; -} - -/********************************************************************** - * hb_libmpeg2_close - ********************************************************************** - * - *********************************************************************/ -static void hb_libmpeg2_close( hb_libmpeg2_t ** _m ) -{ - hb_libmpeg2_t * m = *_m; - - mpeg2_close( m->libmpeg2 ); - - if ( m->sws_context ) - { - sws_freeContext( m->sws_context ); - } - - int i; - for ( i = 0; i < NTAGS; ++i ) - { - if ( m->tags[i].cc_buf ) - { - if ( m->tags[i].cc_buf == m->last_cc1_buf ) - m->last_cc1_buf = NULL; - hb_buffer_close( &m->tags[i].cc_buf ); - } - } - if ( m->last_cc1_buf ) - { - hb_buffer_close( &m->last_cc1_buf ); - } - - free( m ); - *_m = NULL; -} - -/********************************************************************** - * The decmpeg2 work object - ********************************************************************** - * - *********************************************************************/ -struct hb_work_private_s -{ - hb_libmpeg2_t * libmpeg2; - hb_list_t * list; -}; - -/********************************************************************** - * hb_work_decmpeg2_init - ********************************************************************** - * - *********************************************************************/ -static int decmpeg2Init( hb_work_object_t * w, hb_job_t * job ) -{ - hb_work_private_t * pv; - - pv = calloc( 1, sizeof( hb_work_private_t ) ); - w->private_data = pv; - - pv->libmpeg2 = hb_libmpeg2_init(); - pv->list = hb_list_init(); - - pv->libmpeg2->job = job; - - if( job && job->title ) { - pv->libmpeg2->title = job->title; - } - - /* - * If not scanning, then are we supposed to extract Closed Captions - * and send them to the decoder? - */ - if( job && hb_list_count( job->list_subtitle ) > 0 ) - { - hb_subtitle_t *subtitle; - int i = 0; - - for( i = 0; i < hb_list_count( job->list_subtitle ); i++ ) - while ( ( subtitle = hb_list_item( job->list_subtitle, i++ ) ) != NULL ) - { - if( subtitle->source == CC608SUB ) - { - if ( ! pv->libmpeg2->list_subtitle ) - { - pv->libmpeg2->list_subtitle = hb_list_init(); - } - hb_list_add(pv->libmpeg2->list_subtitle, subtitle); - } - } - } - - return 0; -} - -/********************************************************************** - * Work - ********************************************************************** - * - *********************************************************************/ -static int decmpeg2Work( hb_work_object_t * w, hb_buffer_t ** buf_in, - hb_buffer_t ** buf_out ) -{ - hb_work_private_t * pv = w->private_data; - hb_buffer_t * buf, * last = NULL; - hb_buffer_t * in = *buf_in; - int status = HB_WORK_OK; - - if( w->title && pv && pv->libmpeg2 && !pv->libmpeg2->title ) { - pv->libmpeg2->title = w->title; - } - - // The reader found a chapter break. Remove it from the input - // stream. If we're reading (as opposed to scanning) start looking - // for the next GOP start since that's where the chapter begins. - if( in->s.new_chap ) - { - if ( pv->libmpeg2->job ) - { - pv->libmpeg2->look_for_break = in->s.new_chap; - } - in->s.new_chap = 0; - } - - hb_libmpeg2_decode( pv->libmpeg2, in, pv->list ); - - /* if we got an empty buffer signaling end-of-stream send it downstream */ - if ( in->size == 0 ) - { - hb_list_add( pv->list, in ); - *buf_in = NULL; - status = HB_WORK_DONE; - - /* - * Purge any pending caption buffer then let the Closed Captions decoder - * know that it is the end of the data. - */ - if ( pv->libmpeg2->list_subtitle ) - { - if ( pv->libmpeg2->last_cc1_buf ) - { - cc_send_to_decoder( pv->libmpeg2, pv->libmpeg2->last_cc1_buf ); - if ( pv->libmpeg2->tags[pv->libmpeg2->cur_tag].cc_buf == - pv->libmpeg2->last_cc1_buf ) - { - pv->libmpeg2->tags[pv->libmpeg2->cur_tag].cc_buf = NULL; - } - pv->libmpeg2->last_cc1_buf = NULL; - } - cc_send_to_decoder( pv->libmpeg2, hb_buffer_init( 0 ) ); - } - } - - *buf_out = NULL; - while( ( buf = hb_list_item( pv->list, 0 ) ) ) - { - hb_list_rem( pv->list, buf ); - if( last ) - { - last->next = buf; - last = buf; - } - else - { - *buf_out = buf; - last = buf; - } - } - - return status; -} - -/********************************************************************** - * Close - ********************************************************************** - * - *********************************************************************/ -static void decmpeg2Close( hb_work_object_t * w ) -{ - hb_work_private_t * pv = w->private_data; - - // don't log during scan - if ( pv->libmpeg2->job ) - { - hb_log( "mpeg2 done: %d frames", pv->libmpeg2->nframes ); - } - hb_list_empty( &pv->list ); - if ( pv->libmpeg2->list_subtitle ) - { - hb_list_close( &pv->libmpeg2->list_subtitle ); - } - hb_libmpeg2_close( &pv->libmpeg2 ); - free( pv ); -} - -static int decmpeg2Info( hb_work_object_t *w, hb_work_info_t *info ) -{ - hb_work_private_t *pv = w->private_data; - - memset( info, 0, sizeof(*info) ); - - if ( pv && pv->libmpeg2 && pv->libmpeg2->info && pv->libmpeg2->info->sequence ) - { - hb_libmpeg2_t *m = pv->libmpeg2; - - info->width = m->width; - info->height = m->height; - info->pixel_aspect_width = m->info->sequence->pixel_width; - info->pixel_aspect_height = m->info->sequence->pixel_height; - - // if the frame is progressive & NTSC DVD height report it as 23.976 FPS - // so that scan can autodetect NTSC film - info->rate = 27000000; - info->rate_base = ( m->info->display_fbuf && m->info->display_picture && - (m->info->display_picture->flags & PROGRESSIVE) && - (m->height == 480 ) ) ? 1126125 : m->rate; - - info->name = "mpeg2"; - info->video_decode_support = HB_DECODE_SUPPORT_SW; - info->bitrate = m->info->sequence->byte_rate * 8; - info->profile = m->info->sequence->profile_level_id >> 4; - info->level = m->info->sequence->profile_level_id & 0xf; - - if( pv->libmpeg2->info->sequence->flags & SEQ_FLAG_COLOUR_DESCRIPTION ) - { - switch( pv->libmpeg2->info->sequence->colour_primaries ) - { - case 1: // ITU-R Recommendation 709 - info->color_prim = HB_COLR_PRI_BT709; - break; - case 5: // ITU-R Recommendation 624-4 System B, G - info->color_prim = HB_COLR_PRI_EBUTECH; - break; - case 4: // ITU-R Recommendation 624-4 System M - case 6: // SMPTE 170M - case 7: // SMPTE 240M - info->color_prim = HB_COLR_PRI_SMPTEC; - break; - default: - info->color_prim = HB_COLR_PRI_UNDEF; - break; - } - switch( pv->libmpeg2->info->sequence->transfer_characteristics ) - { - case 1: // ITU-R Recommendation 709 - case 4: // ITU-R Recommendation 624-4 System M - case 5: // ITU-R Recommendation 624-4 System B, G - case 6: // SMPTE 170M - info->color_transfer = HB_COLR_TRA_BT709; - break; - case 7: // SMPTE 240M - info->color_transfer = HB_COLR_TRA_SMPTE240M; - break; - default: - info->color_transfer = HB_COLR_TRA_UNDEF; - break; - } - switch( pv->libmpeg2->info->sequence->matrix_coefficients ) - { - case 1: // ITU-R Recommendation 709 - info->color_matrix = HB_COLR_MAT_BT709; - break; - case 4: // FCC - case 5: // ITU-R Recommendation 624-4 System B, G - case 6: // SMPTE 170M - info->color_matrix = HB_COLR_MAT_SMPTE170M; - break; - case 7: // SMPTE 240M - info->color_matrix = HB_COLR_MAT_SMPTE240M; - break; - default: - info->color_matrix = HB_COLR_MAT_UNDEF; - break; - } - } - else if( ( info->width >= 1280 || info->height >= 720 ) || - ( info->width > 720 && info->height > 576 ) ) - { - // ITU BT.709 HD content - info->color_prim = HB_COLR_PRI_BT709; - info->color_transfer = HB_COLR_TRA_BT709; - info->color_matrix = HB_COLR_MAT_BT709; - } - else if( info->rate_base == 1080000 ) - { - // ITU BT.601 DVD or SD TV content (PAL) - info->color_prim = HB_COLR_PRI_EBUTECH; - info->color_transfer = HB_COLR_TRA_BT709; - info->color_matrix = HB_COLR_MAT_SMPTE170M; - } - else - { - // ITU BT.601 DVD or SD TV content (NTSC) - info->color_prim = HB_COLR_PRI_SMPTEC; - info->color_transfer = HB_COLR_TRA_BT709; - info->color_matrix = HB_COLR_MAT_SMPTE170M; - } - - return 1; - } - return 0; -} - -static void decmpeg2Flush( hb_work_object_t *w ) -{ - hb_work_private_t * pv = w->private_data; - - mpeg2_reset( pv->libmpeg2->libmpeg2, 0 ); - pv->libmpeg2->got_iframe = 0; -} - -hb_work_object_t hb_decmpeg2 = -{ - .id = WORK_DECMPEG2, - .name = "MPEG-2 decoder (libmpeg2)", - .init = decmpeg2Init, - .work = decmpeg2Work, - .close = decmpeg2Close, - .flush = decmpeg2Flush, - .info = decmpeg2Info -}; - diff --git a/libhb/decomb.c b/libhb/decomb.c index a05605d0d..040cdbebc 100644 --- a/libhb/decomb.c +++ b/libhb/decomb.c @@ -68,7 +68,6 @@ which will feed EEDI2 interpolations to yadif. #include "hb.h" #include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" #include "eedi2.h" #include "taskset.h" diff --git a/libhb/deinterlace.c b/libhb/deinterlace.c index 69b1c31bc..44ff88d90 100644 --- a/libhb/deinterlace.c +++ b/libhb/deinterlace.c @@ -18,7 +18,6 @@ #include "hb.h" #include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" #include "taskset.h" // yadif_mode is a bit vector with the following flags diff --git a/libhb/denoise.c b/libhb/denoise.c index 626bf18ad..9308d041f 100644 --- a/libhb/denoise.c +++ b/libhb/denoise.c @@ -19,7 +19,6 @@ #include "hb.h" #include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" #define HQDN3D_SPATIAL_LUMA_DEFAULT 4.0f #define HQDN3D_SPATIAL_CHROMA_DEFAULT 3.0f diff --git a/libhb/detelecine.c b/libhb/detelecine.c index 2fdc48038..67699de67 100644 --- a/libhb/detelecine.c +++ b/libhb/detelecine.c @@ -9,7 +9,6 @@ #include "hb.h" #include "hbffmpeg.h" -#include "mpeg2dec/mpeg2.h" /* * diff --git a/libhb/hb.c b/libhb/hb.c index b9730802d..2b9609aa6 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1656,7 +1656,6 @@ int hb_global_init() hb_register(&hb_decavcodeca); hb_register(&hb_declpcm); hb_register(&hb_deccc608); - hb_register(&hb_decmpeg2); hb_register(&hb_decpgssub); hb_register(&hb_decsrtsub); hb_register(&hb_decssasub); diff --git a/libhb/internal.h b/libhb/internal.h index 24e29932e..6fa74d591 100644 --- a/libhb/internal.h +++ b/libhb/internal.h @@ -7,8 +7,6 @@ For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html */ -#define USE_FF_MPEG2 - #include "hbffmpeg.h" #include "extras/cl.h" @@ -409,9 +407,9 @@ union hb_esconfig_u enum { - WORK_SYNC_VIDEO = 1, + WORK_NONE = 0, + WORK_SYNC_VIDEO, WORK_SYNC_AUDIO, - WORK_DECMPEG2, WORK_DECCC608, WORK_DECVOBSUB, WORK_DECSRTSUB, diff --git a/libhb/module.defs b/libhb/module.defs index 3102beafa..23f8d9863 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -35,9 +35,6 @@ LIBHB.out += $(LIBHB.a) ############################################################################### -ifeq (1,$(FEATURE.ff.mpeg2)) -LIBHB.GCC.D += USE_FF_MPEG2 -endif ifeq (1,$(FEATURE.fdk_aac)) LIBHB.GCC.D += USE_FDK_AAC endif diff --git a/libhb/scan.c b/libhb/scan.c index cc36fe5da..833589f6c 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -517,15 +517,12 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) data->stream = hb_stream_open( title->path, title, 1 ); } - int vcodec = title->video_codec? title->video_codec : WORK_DECMPEG2; -#if defined(USE_FF_MPEG2) - if (vcodec == WORK_DECMPEG2) + if (title->video_codec == WORK_NONE) { - vcodec = WORK_DECAVCODECV; - title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO; + hb_error("No video decoder set!"); + return 0; } -#endif - hb_work_object_t *vid_decoder = hb_get_work( vcodec ); + hb_work_object_t *vid_decoder = hb_get_work(title->video_codec); vid_decoder->codec_param = title->video_codec_param; vid_decoder->title = title; vid_decoder->init( vid_decoder, NULL ); diff --git a/libhb/stream.c b/libhb/stream.c index 1cb45fcad..6378da3a2 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -49,8 +49,8 @@ typedef struct { static const stream2codec_t st2codec[256] = { st(0x00, U, 0, 0, NULL), - st(0x01, V, WORK_DECMPEG2, 0, "MPEG1"), - st(0x02, V, WORK_DECMPEG2, AV_CODEC_ID_MPEG2VIDEO, "MPEG2"), + st(0x01, V, WORK_DECAVCODEC, AV_CODEC_ID_MPEG2VIDEO, "MPEG1"), + st(0x02, V, WORK_DECAVCODEC, AV_CODEC_ID_MPEG2VIDEO, "MPEG2"), st(0x03, A, HB_ACODEC_FFMPEG, AV_CODEC_ID_MP2, "MPEG1"), st(0x04, A, HB_ACODEC_FFMPEG, AV_CODEC_ID_MP2, "MPEG2"), st(0x05, N, 0, 0, "ISO 13818-1 private section"), @@ -4211,12 +4211,12 @@ static int do_probe( hb_pes_stream_t *pes, hb_buffer_t *buf ) switch ( codec->id ) { case AV_CODEC_ID_MPEG1VIDEO: - pes->codec = WORK_DECMPEG2; + pes->codec = WORK_DECAVCODECV; pes->stream_type = 0x01; break; case AV_CODEC_ID_MPEG2VIDEO: - pes->codec = WORK_DECMPEG2; + pes->codec = WORK_DECAVCODECV; pes->stream_type = 0x02; break; diff --git a/libhb/work.c b/libhb/work.c index 7bb8eab4f..05f76d46e 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1154,16 +1154,12 @@ static void do_job(hb_job_t *job) sync = hb_sync_init( job ); /* Video decoder */ - int vcodec = title->video_codec? title->video_codec : WORK_DECMPEG2; -#if defined(USE_FF_MPEG2) - if (vcodec == WORK_DECMPEG2) + if (title->video_codec == WORK_NONE) { - vcodec = WORK_DECAVCODECV; - title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO; + hb_error("No video decoder set!"); + goto cleanup; } -#endif - - hb_list_add( job->list_work, ( w = hb_get_work( vcodec ) ) ); + hb_list_add(job->list_work, (w = hb_get_work(title->video_codec))); w->codec_param = title->video_codec_param; w->fifo_in = job->fifo_mpeg2; w->fifo_out = job->fifo_raw; diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 2b5a3a7f8..0c5a98ba6 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -100,8 +100,6 @@ 27D6C75A14B102DA00B785E4 /* libfribidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73314B102DA00B785E4 /* libfribidi.a */; }; 27D6C75E14B102DA00B785E4 /* libmp3lame.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73614B102DA00B785E4 /* libmp3lame.a */; }; 27D6C75F14B102DA00B785E4 /* libmp3lame.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73614B102DA00B785E4 /* libmp3lame.a */; }; - 27D6C76214B102DA00B785E4 /* libmpeg2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73814B102DA00B785E4 /* libmpeg2.a */; }; - 27D6C76314B102DA00B785E4 /* libmpeg2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73814B102DA00B785E4 /* libmpeg2.a */; }; 27D6C76414B102DA00B785E4 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73914B102DA00B785E4 /* libogg.a */; }; 27D6C76514B102DA00B785E4 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73914B102DA00B785E4 /* libogg.a */; }; 27D6C76614B102DA00B785E4 /* libsamplerate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D6C73A14B102DA00B785E4 /* libsamplerate.a */; }; @@ -302,7 +300,6 @@ 27D6C73214B102DA00B785E4 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = external/contrib/lib/libfreetype.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73314B102DA00B785E4 /* libfribidi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfribidi.a; path = external/contrib/lib/libfribidi.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73614B102DA00B785E4 /* libmp3lame.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmp3lame.a; path = external/contrib/lib/libmp3lame.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 27D6C73814B102DA00B785E4 /* libmpeg2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmpeg2.a; path = external/contrib/lib/libmpeg2.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73914B102DA00B785E4 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = external/contrib/lib/libogg.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73A14B102DA00B785E4 /* libsamplerate.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsamplerate.a; path = external/contrib/lib/libsamplerate.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73B14B102DA00B785E4 /* libswscale.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswscale.a; path = external/contrib/lib/libswscale.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -375,7 +372,6 @@ 27D6C75814B102DA00B785E4 /* libfreetype.a in Frameworks */, 27D6C75A14B102DA00B785E4 /* libfribidi.a in Frameworks */, 27D6C75F14B102DA00B785E4 /* libmp3lame.a in Frameworks */, - 27D6C76314B102DA00B785E4 /* libmpeg2.a in Frameworks */, 27D6C76514B102DA00B785E4 /* libogg.a in Frameworks */, 27D6C76714B102DA00B785E4 /* libsamplerate.a in Frameworks */, 27D6C76914B102DA00B785E4 /* libswscale.a in Frameworks */, @@ -415,7 +411,6 @@ 27D6C75714B102DA00B785E4 /* libfreetype.a in Frameworks */, 27D6C75914B102DA00B785E4 /* libfribidi.a in Frameworks */, 27D6C75E14B102DA00B785E4 /* libmp3lame.a in Frameworks */, - 27D6C76214B102DA00B785E4 /* libmpeg2.a in Frameworks */, 27D6C76414B102DA00B785E4 /* libogg.a in Frameworks */, 27D6C76614B102DA00B785E4 /* libsamplerate.a in Frameworks */, 27D6C76814B102DA00B785E4 /* libswscale.a in Frameworks */, @@ -447,7 +442,6 @@ 27D6C73214B102DA00B785E4 /* libfreetype.a */, 27D6C73314B102DA00B785E4 /* libfribidi.a */, 27D6C73614B102DA00B785E4 /* libmp3lame.a */, - 27D6C73814B102DA00B785E4 /* libmpeg2.a */, 27D6C73914B102DA00B785E4 /* libogg.a */, 27D6C73A14B102DA00B785E4 /* libsamplerate.a */, 27D6C73B14B102DA00B785E4 /* libswscale.a */, diff --git a/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj b/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj index e6c34f450..6c69d63cc 100644 --- a/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj +++ b/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj @@ -393,7 +393,6 @@ ../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, diff --git a/macosx/InstantHandBrake/libhb.xcodeproj/project.pbxproj b/macosx/InstantHandBrake/libhb.xcodeproj/project.pbxproj index b52e8381e..6540bcf90 100644 --- a/macosx/InstantHandBrake/libhb.xcodeproj/project.pbxproj +++ b/macosx/InstantHandBrake/libhb.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ A9DB39140D37EA0300F77345 /* decavcodec.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38EB0D37EA0300F77345 /* decavcodec.c */; }; A9DB39150D37EA0300F77345 /* decdca.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38EC0D37EA0300F77345 /* decdca.c */; }; A9DB39160D37EA0300F77345 /* declpcm.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38ED0D37EA0300F77345 /* declpcm.c */; }; - A9DB39170D37EA0300F77345 /* decmpeg2.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38EE0D37EA0300F77345 /* decmpeg2.c */; }; A9DB39180D37EA0300F77345 /* decsub.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38EF0D37EA0300F77345 /* decsub.c */; }; A9DB39190D37EA0300F77345 /* deinterlace.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38F00D37EA0300F77345 /* deinterlace.c */; }; A9DB391A0D37EA0300F77345 /* demuxmpeg.c in Sources */ = {isa = PBXBuildFile; fileRef = A9DB38F10D37EA0300F77345 /* demuxmpeg.c */; }; @@ -59,7 +58,6 @@ A9DB39BA0D37EB4700F77345 /* libmkv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39A50D37EB4700F77345 /* libmkv.a */; }; A9DB39BB0D37EB4700F77345 /* libmp3lame.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39A60D37EB4700F77345 /* libmp3lame.a */; }; A9DB39BC0D37EB4700F77345 /* libmp4v2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39A70D37EB4700F77345 /* libmp4v2.a */; }; - A9DB39BD0D37EB4700F77345 /* libmpeg2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39A80D37EB4700F77345 /* libmpeg2.a */; }; A9DB39BE0D37EB4700F77345 /* libmpeg2convert.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39A90D37EB4700F77345 /* libmpeg2convert.a */; }; A9DB39BF0D37EB4700F77345 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39AA0D37EB4700F77345 /* libogg.a */; }; A9DB39C00D37EB4700F77345 /* libsamplerate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DB39AB0D37EB4700F77345 /* libsamplerate.a */; }; @@ -85,7 +83,6 @@ A9DB38EB0D37EA0300F77345 /* decavcodec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decavcodec.c; path = ../../libhb/decavcodec.c; sourceTree = SOURCE_ROOT; }; A9DB38EC0D37EA0300F77345 /* decdca.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decdca.c; path = ../../libhb/decdca.c; sourceTree = SOURCE_ROOT; }; A9DB38ED0D37EA0300F77345 /* declpcm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = declpcm.c; path = ../../libhb/declpcm.c; sourceTree = SOURCE_ROOT; }; - A9DB38EE0D37EA0300F77345 /* decmpeg2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decmpeg2.c; path = ../../libhb/decmpeg2.c; sourceTree = SOURCE_ROOT; }; A9DB38EF0D37EA0300F77345 /* decsub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = decsub.c; path = ../../libhb/decsub.c; sourceTree = SOURCE_ROOT; }; A9DB38F00D37EA0300F77345 /* deinterlace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = deinterlace.c; path = ../../libhb/deinterlace.c; sourceTree = SOURCE_ROOT; }; A9DB38F10D37EA0300F77345 /* demuxmpeg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = demuxmpeg.c; path = ../../libhb/demuxmpeg.c; sourceTree = SOURCE_ROOT; }; @@ -130,7 +127,6 @@ A9DB39A50D37EB4700F77345 /* libmkv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmkv.a; path = ../../contrib/lib/libmkv.a; sourceTree = SOURCE_ROOT; }; A9DB39A60D37EB4700F77345 /* libmp3lame.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmp3lame.a; path = ../../contrib/lib/libmp3lame.a; sourceTree = SOURCE_ROOT; }; A9DB39A70D37EB4700F77345 /* libmp4v2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmp4v2.a; path = ../../contrib/lib/libmp4v2.a; sourceTree = SOURCE_ROOT; }; - A9DB39A80D37EB4700F77345 /* libmpeg2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmpeg2.a; path = ../../contrib/lib/libmpeg2.a; sourceTree = SOURCE_ROOT; }; A9DB39A90D37EB4700F77345 /* libmpeg2convert.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmpeg2convert.a; path = ../../contrib/lib/libmpeg2convert.a; sourceTree = SOURCE_ROOT; }; A9DB39AA0D37EB4700F77345 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = ../../contrib/lib/libogg.a; sourceTree = SOURCE_ROOT; }; A9DB39AB0D37EB4700F77345 /* libsamplerate.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsamplerate.a; path = ../../contrib/lib/libsamplerate.a; sourceTree = SOURCE_ROOT; }; @@ -158,7 +154,6 @@ A9DB39BA0D37EB4700F77345 /* libmkv.a in Frameworks */, A9DB39BB0D37EB4700F77345 /* libmp3lame.a in Frameworks */, A9DB39BC0D37EB4700F77345 /* libmp4v2.a in Frameworks */, - A9DB39BD0D37EB4700F77345 /* libmpeg2.a in Frameworks */, A9DB39BE0D37EB4700F77345 /* libmpeg2convert.a in Frameworks */, A9DB39BF0D37EB4700F77345 /* libogg.a in Frameworks */, A9DB39C00D37EB4700F77345 /* libsamplerate.a in Frameworks */, @@ -192,7 +187,6 @@ A9DB38EB0D37EA0300F77345 /* decavcodec.c */, A9DB38EC0D37EA0300F77345 /* decdca.c */, A9DB38ED0D37EA0300F77345 /* declpcm.c */, - A9DB38EE0D37EA0300F77345 /* decmpeg2.c */, A9DB38EF0D37EA0300F77345 /* decsub.c */, A9DB38F00D37EA0300F77345 /* deinterlace.c */, A9DB38F10D37EA0300F77345 /* demuxmpeg.c */, @@ -246,7 +240,6 @@ A9DB39A50D37EB4700F77345 /* libmkv.a */, A9DB39A60D37EB4700F77345 /* libmp3lame.a */, A9DB39A70D37EB4700F77345 /* libmp4v2.a */, - A9DB39A80D37EB4700F77345 /* libmpeg2.a */, A9DB39A90D37EB4700F77345 /* libmpeg2convert.a */, A9DB39AA0D37EB4700F77345 /* libogg.a */, A9DB39AB0D37EB4700F77345 /* libsamplerate.a */, @@ -328,7 +321,6 @@ A9DB39140D37EA0300F77345 /* decavcodec.c in Sources */, A9DB39150D37EA0300F77345 /* decdca.c in Sources */, A9DB39160D37EA0300F77345 /* declpcm.c in Sources */, - A9DB39170D37EA0300F77345 /* decmpeg2.c in Sources */, A9DB39180D37EA0300F77345 /* decsub.c in Sources */, A9DB39190D37EA0300F77345 /* deinterlace.c in Sources */, A9DB391A0D37EA0300F77345 /* demuxmpeg.c in Sources */, diff --git a/make/configure.py b/make/configure.py index 1b71619c8..7cf99ca2e 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1173,8 +1173,6 @@ def createCLI(): grp.add_option( '--enable-gtk-mingw', default=False, action='store_true', help=h ) h = IfHost( 'disable gstreamer (live preview)', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value grp.add_option( '--disable-gst', default=False, action='store_true', help=h ) - h = IfHost( 'enable use of ffmpeg mpeg2 decoding', '*-*-*', none=optparse.SUPPRESS_HELP ).value - grp.add_option( '--enable-ff-mpeg2', default=False, action='store_true', help=h ) h = IfHost( 'enable use of Intel Quick Sync Video hardware acceleration', '*-*-*', none=optparse.SUPPRESS_HELP ).value grp.add_option( '--enable-qsv', default=False, action='store_true', help=h ) @@ -1643,7 +1641,6 @@ int main () doc.add( 'FEATURE.gtk.update.checks', int( not options.disable_gtk_update_checks )) doc.add( 'FEATURE.gtk.mingw', int( options.enable_gtk_mingw )) doc.add( 'FEATURE.gst', int( not options.disable_gst )) - doc.add( 'FEATURE.ff.mpeg2', int( options.enable_ff_mpeg2 )) doc.add( 'FEATURE.fdk_aac', int( options.enable_fdk_aac )) doc.add( 'FEATURE.libav_aac', int( options.enable_libav_aac )) doc.add( 'FEATURE.faac', int( options.enable_faac )) diff --git a/make/include/main.defs b/make/include/main.defs index bf6c5f4ec..dde127c9a 100644 --- a/make/include/main.defs +++ b/make/include/main.defs @@ -60,7 +60,6 @@ MODULES += contrib/ffmpeg MODULES += contrib/libdvdread MODULES += contrib/libdvdnav MODULES += contrib/libbluray -MODULES += contrib/mpeg2dec ifneq (,$(filter $(BUILD.system),mingw)) ifneq ($(HAS.pthread),1) diff --git a/test/module.defs b/test/module.defs index 7124895bf..d231ccb78 100644 --- a/test/module.defs +++ b/test/module.defs @@ -15,7 +15,7 @@ TEST.libs = $(LIBHB.a) TEST.GCC.l = \ a52 ass avcodec avformat avutil avresample dvdnav dvdread \ - fontconfig freetype fribidi mpeg2 mp3lame ogg \ + fontconfig freetype fribidi mp3lame ogg \ samplerate swscale theoraenc theoradec vorbis vorbisenc x264 \ bluray xml2 bz2 z |