[-]
[+]
|
Changed |
libquicktime.changes
|
|
[-]
[+]
|
Changed |
libquicktime.spec
^
|
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/config.h.in
^
|
@@ -218,6 +218,9 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
+/* Header for vdpau */
+#undef VDPAU_HEADER
+
/* Version number of package */
#undef VERSION
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/configure
^
|
@@ -778,16 +778,16 @@
HAVE_LIBPNG_TRUE
LIBPNG_LIBS
LIBPNG_CFLAGS
-HAVE_LIBSWSCALE_FALSE
-HAVE_LIBSWSCALE_TRUE
-LIBSWSCALE_REQUIRED
-LIBSWSCALE_LIBS
-LIBSWSCALE_CFLAGS
AVCODEC_REQUIRED
HAVE_LIBAVCODEC_FALSE
HAVE_LIBAVCODEC_TRUE
AVCODEC_LIBS
AVCODEC_CFLAGS
+HAVE_LIBSWSCALE_FALSE
+HAVE_LIBSWSCALE_TRUE
+LIBSWSCALE_REQUIRED
+LIBSWSCALE_LIBS
+LIBSWSCALE_CFLAGS
HAVE_LIBJPEG_FALSE
HAVE_LIBJPEG_TRUE
JPEG_REQUIRED
@@ -1004,9 +1004,9 @@
with_gtk
with_libdv
with_libjpeg
+enable_libswscale
with_ffmpeg
with_avcodec
-enable_libswscale
with_libpng
with_schroedinger
with_faac
@@ -1033,10 +1033,10 @@
GTK_LIBS
LIBDV_CFLAGS
LIBDV_LIBS
-AVCODEC_CFLAGS
-AVCODEC_LIBS
LIBSWSCALE_CFLAGS
LIBSWSCALE_LIBS
+AVCODEC_CFLAGS
+AVCODEC_LIBS
LIBPNG_CFLAGS
LIBPNG_LIBS
SCHROEDINGER_CFLAGS
@@ -1735,14 +1735,14 @@
LIBDV_CFLAGS
C compiler flags for LIBDV, overriding pkg-config
LIBDV_LIBS linker flags for LIBDV, overriding pkg-config
- AVCODEC_CFLAGS
- C compiler flags for AVCODEC, overriding pkg-config
- AVCODEC_LIBS
- linker flags for AVCODEC, overriding pkg-config
LIBSWSCALE_CFLAGS
C compiler flags for LIBSWSCALE, overriding pkg-config
LIBSWSCALE_LIBS
linker flags for LIBSWSCALE, overriding pkg-config
+ AVCODEC_CFLAGS
+ C compiler flags for AVCODEC, overriding pkg-config
+ AVCODEC_LIBS
+ linker flags for AVCODEC, overriding pkg-config
LIBPNG_CFLAGS
C compiler flags for LIBPNG, overriding pkg-config
LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
@@ -3050,7 +3050,7 @@
# Define the identity of the package.
PACKAGE=libquicktime
- VERSION=1.2.3
+ VERSION=1.2.4
cat >>confdefs.h <<_ACEOF
@@ -3241,10 +3241,6 @@
-cat >>confdefs.h <<_ACEOF
-#define LQT_CODEC_API_VERSION $LQT_CODEC_API_VERSION
-_ACEOF
-
if test "x$have_gpl" = "xtrue"; then
LQT_CODEC_API_VERSION="($LQT_CODEC_API_VERSION|0x10000)"
@@ -3252,8 +3248,6 @@
fi
-
-
cat >>confdefs.h <<_ACEOF
#define LQT_CODEC_API_VERSION $LQT_CODEC_API_VERSION
_ACEOF
@@ -4885,13 +4879,13 @@
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:4888: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:4882: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:4891: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:4885: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:4894: output\"" >&5)
+ (eval echo "\"\$as_me:4888: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6097,7 +6091,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6100 "configure"' > conftest.$ac_ext
+ echo '#line 6094 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7579,11 +7573,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7582: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7576: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7586: \$? = $ac_status" >&5
+ echo "$as_me:7580: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7918,11 +7912,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7921: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7915: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7925: \$? = $ac_status" >&5
+ echo "$as_me:7919: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8023,11 +8017,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8026: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8020: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8030: \$? = $ac_status" >&5
+ echo "$as_me:8024: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8078,11 +8072,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8081: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8075: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8085: \$? = $ac_status" >&5
+ echo "$as_me:8079: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10462,7 +10456,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10465 "configure"
+#line 10459 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10558,7 +10552,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10561 "configure"
+#line 10555 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16510,10 +16504,188 @@
+have_libswscale=false
+
+LIBSWSCALE_REQUIRED="0.5.0"
+
+# Check whether --enable-libswscale was given.
+if test "${enable_libswscale+set}" = set; then :
+ enableval=$enable_libswscale; case "${enableval}" in
+ yes) test_libswscale=true ;;
+ no) test_libswscale=false ;;
+esac
+else
+ test_libswscale=true
+fi
+
+
+if test x$test_libswscale = xtrue; then
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSWSCALE" >&5
+$as_echo_n "checking for LIBSWSCALE... " >&6; }
+
+if test -n "$PKG_CONFIG"; then
+ if test -n "$LIBSWSCALE_CFLAGS"; then
+ pkg_cv_LIBSWSCALE_CFLAGS="$LIBSWSCALE_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale >= \$LIBSWSCALE_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libswscale >= $LIBSWSCALE_REQUIRED") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSWSCALE_CFLAGS=`$PKG_CONFIG --cflags "libswscale >= $LIBSWSCALE_REQUIRED" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ fi
+else
+ pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+ if test -n "$LIBSWSCALE_LIBS"; then
+ pkg_cv_LIBSWSCALE_LIBS="$LIBSWSCALE_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale >= \$LIBSWSCALE_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libswscale >= $LIBSWSCALE_REQUIRED") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSWSCALE_LIBS=`$PKG_CONFIG --libs "libswscale >= $LIBSWSCALE_REQUIRED" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ fi
+else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libswscale >= $LIBSWSCALE_REQUIRED"`
+ else
+ LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libswscale >= $LIBSWSCALE_REQUIRED"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBSWSCALE_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ have_libswscale="false"
+elif test $pkg_failed = untried; then
+ have_libswscale="false"
+else
+ LIBSWSCALE_CFLAGS=$pkg_cv_LIBSWSCALE_CFLAGS
+ LIBSWSCALE_LIBS=$pkg_cv_LIBSWSCALE_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_libswscale="true"
+fi
+fi
+
+CFLAGS_save=$CFLAGS
+CFLAGS="$CFLAGS $LIBSWSCALE_CFLAGS"
+found_header="false"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <swscale.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ found_header="true";SWSCALE_HEADER="<swscale.h>"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $found_header = "false"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <swscale/swscale.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ found_header="true";SWSCALE_HEADER="<swscale/swscale.h>"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test $found_header = "false"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libswscale/swscale.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ found_header="true";SWSCALE_HEADER="<libswscale/swscale.h>"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+CFLAGS="$CFLAGS_save"
+
+
+
+
+
+ if test x$have_libswscale = xtrue; then
+ HAVE_LIBSWSCALE_TRUE=
+ HAVE_LIBSWSCALE_FALSE='#'
+else
+ HAVE_LIBSWSCALE_TRUE='#'
+ HAVE_LIBSWSCALE_FALSE=
+fi
+
+
+if test "x$have_libswscale" = "xtrue"; then
+$as_echo "#define HAVE_LIBSWSCALE 1" >>confdefs.h
+
+cat >>confdefs.h <<_ACEOF
+#define SWSCALE_HEADER $SWSCALE_HEADER
+_ACEOF
+
+fi
+
+
+
+
+
+
have_libavcodec=false
-AVCODEC_BUILD="3277056"
+AVCODEC_BUILD="3412992"
# Check whether --with-ffmpeg was given.
@@ -16540,6 +16712,7 @@
+
if test "x$avcodec_prefix" != x; then
AVCODEC_CFLAGS="-I$avcodec_prefix/include"
AVCODEC_LIBS="-L$avcodec_prefix/lib -lavcodec"
@@ -16549,14 +16722,15 @@
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
+CFLAGS="$GMERLIN_DEP_CFLAGS $CFLAGS $AVCODEC_CFLAGS"
+LIBS="$GMERLIN_DEP_LIBS $AVCODEC_LIBS"
+
AVCODEC_HEADER=""
found_header="false"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <libavcodec/avcodec.h>
int
main ()
@@ -16567,14 +16741,13 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>";VDPAU_HEADER="<libavcodec/vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $found_header = "false"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <avcodec.h>
int
main ()
@@ -16585,7 +16758,7 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<avcodec.h>";VDPAU_HEADER="<vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
@@ -16593,7 +16766,6 @@
if test $found_header = "false"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <ffmpeg/avcodec.h>
int
main ()
@@ -16604,13 +16776,11 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>";VDPAU_HEADER="<vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
-LIBS="$LIBS $AVCODEC_LIBS"
avcodec_ok="false"
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -16657,6 +16827,48 @@
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+
+have_avcodec_img_convert="false"
+
+if test "x$avcodec_ok" = "xtrue"; then
+
+avcodec_swscale_missing="false"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for img_convert" >&5
+$as_echo_n "checking for img_convert... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <avcodec.h>
+int
+main ()
+{
+img_convert(NULL, 0, NULL, 0, 0, 0);
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ have_avcodec_img_convert=true
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+if test "x$have_avcodec_img_convert" != "xtrue"; then
+ if test "x$have_libswscale" != "xtrue"; then
+ avcodec_swscale_missing="true"
+ avcodec_ok="false"
+ fi
+fi
+
+fi
+
CFLAGS="$CFLAGS_save"
LIBS="$LIBS_save"
@@ -16739,19 +16951,26 @@
avcodec_orig="true"
fi
+
+ if test "x$os_win32" = "xyes"; then
+ AVCODEC_LIBS="-L/usr/local/bin $AVCODEC_LIBS"
+ fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build ID in libavcodec, libs: $AVCODEC_LIBS" >&5
$as_echo_n "checking for build ID in libavcodec, libs: $AVCODEC_LIBS... " >&6; }
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
+CFLAGS="$GMERLIN_DEP_CFLAGS $CFLAGS $AVCODEC_CFLAGS"
+LIBS="$GMERLIN_DEP_LIBS $AVCODEC_LIBS"
+
AVCODEC_HEADER=""
found_header="false"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <libavcodec/avcodec.h>
int
main ()
@@ -16762,14 +16981,13 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>";VDPAU_HEADER="<libavcodec/vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $found_header = "false"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <avcodec.h>
int
main ()
@@ -16780,7 +16998,7 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<avcodec.h>";VDPAU_HEADER="<vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
@@ -16788,7 +17006,6 @@
if test $found_header = "false"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
#include <ffmpeg/avcodec.h>
int
main ()
@@ -16799,13 +17016,11 @@
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>"
+ found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>";VDPAU_HEADER="<vdpau.h>"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
-LIBS="$LIBS $AVCODEC_LIBS"
avcodec_ok="false"
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -16852,218 +17067,81 @@
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-CFLAGS="$CFLAGS_save"
-LIBS="$LIBS_save"
-
- if test "x$avcodec_ok" = "xtrue"; then
- avcodec_done="true"
- fi
-fi
-
-if test "x$avcodec_done" = "xtrue"; then
- have_libavcodec="true"
- cat >>confdefs.h <<_ACEOF
-#define AVCODEC_HEADER $AVCODEC_HEADER
-_ACEOF
-
-else
- have_libavcodec="false"
-fi
-
-
-
-fi
-
-AVCODEC_REQUIRED=$AVCODEC_VERSION
-
- if test x$have_libavcodec = xtrue; then
- HAVE_LIBAVCODEC_TRUE=
- HAVE_LIBAVCODEC_FALSE='#'
-else
- HAVE_LIBAVCODEC_TRUE='#'
- HAVE_LIBAVCODEC_FALSE=
-fi
-
-
-
-
-
-
-
-
-
-
-have_libswscale=false
-
-LIBSWSCALE_REQUIRED="0.5.0"
-
-# Check whether --enable-libswscale was given.
-if test "${enable_libswscale+set}" = set; then :
- enableval=$enable_libswscale; case "${enableval}" in
- yes) test_libswscale=true ;;
- no) test_libswscale=false ;;
-esac
-else
- test_libswscale=true
-fi
-
-if test x$test_libswscale = xtrue; then
+have_avcodec_img_convert="false"
+if test "x$avcodec_ok" = "xtrue"; then
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSWSCALE" >&5
-$as_echo_n "checking for LIBSWSCALE... " >&6; }
-
-if test -n "$PKG_CONFIG"; then
- if test -n "$LIBSWSCALE_CFLAGS"; then
- pkg_cv_LIBSWSCALE_CFLAGS="$LIBSWSCALE_CFLAGS"
- else
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale >= \$LIBSWSCALE_REQUIRED\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libswscale >= $LIBSWSCALE_REQUIRED") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBSWSCALE_CFLAGS=`$PKG_CONFIG --cflags "libswscale >= $LIBSWSCALE_REQUIRED" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- fi
-else
- pkg_failed=untried
-fi
-if test -n "$PKG_CONFIG"; then
- if test -n "$LIBSWSCALE_LIBS"; then
- pkg_cv_LIBSWSCALE_LIBS="$LIBSWSCALE_LIBS"
- else
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale >= \$LIBSWSCALE_REQUIRED\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libswscale >= $LIBSWSCALE_REQUIRED") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBSWSCALE_LIBS=`$PKG_CONFIG --libs "libswscale >= $LIBSWSCALE_REQUIRED" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- fi
-else
- pkg_failed=untried
-fi
-
+avcodec_swscale_missing="false"
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libswscale >= $LIBSWSCALE_REQUIRED"`
- else
- LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libswscale >= $LIBSWSCALE_REQUIRED"`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LIBSWSCALE_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- have_libswscale="false"
-elif test $pkg_failed = untried; then
- have_libswscale="false"
-else
- LIBSWSCALE_CFLAGS=$pkg_cv_LIBSWSCALE_CFLAGS
- LIBSWSCALE_LIBS=$pkg_cv_LIBSWSCALE_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- have_libswscale="true"
-fi
-fi
-
-CFLAGS_save=$CFLAGS
-CFLAGS="$CFLAGS $LIBSWSCALE_CFLAGS"
-found_header="false"
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for img_convert" >&5
+$as_echo_n "checking for img_convert... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-#include <swscale.h>
+#include <avcodec.h>
int
main ()
{
-
+img_convert(NULL, 0, NULL, 0, 0, 0);
+ return 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";SWSCALE_HEADER="<swscale.h>"
+if ac_fn_c_try_link "$LINENO"; then :
+ have_avcodec_img_convert=true
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $found_header = "false"; then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <swscale/swscale.h>
-int
-main ()
-{
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";SWSCALE_HEADER="<swscale/swscale.h>"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "x$have_avcodec_img_convert" != "xtrue"; then
+ if test "x$have_libswscale" != "xtrue"; then
+ avcodec_swscale_missing="true"
+ avcodec_ok="false"
+ fi
fi
-if test $found_header = "false"; then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <libswscale/swscale.h>
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- found_header="true";SWSCALE_HEADER="<libswscale/swscale.h>"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
CFLAGS="$CFLAGS_save"
+LIBS="$LIBS_save"
+ if test "x$avcodec_ok" = "xtrue"; then
+ avcodec_done="true"
+ fi
+fi
+if test "x$avcodec_done" = "xtrue"; then
+ have_libavcodec="true"
+ cat >>confdefs.h <<_ACEOF
+#define AVCODEC_HEADER $AVCODEC_HEADER
+_ACEOF
+ cat >>confdefs.h <<_ACEOF
+#define VDPAU_HEADER $VDPAU_HEADER
+_ACEOF
-
- if test x$have_libswscale = xtrue; then
- HAVE_LIBSWSCALE_TRUE=
- HAVE_LIBSWSCALE_FALSE='#'
else
- HAVE_LIBSWSCALE_TRUE='#'
- HAVE_LIBSWSCALE_FALSE=
+ have_libavcodec="false"
fi
-if test "x$have_libswscale" = "xtrue"; then
-$as_echo "#define HAVE_LIBSWSCALE 1" >>confdefs.h
+fi
-cat >>confdefs.h <<_ACEOF
-#define SWSCALE_HEADER $SWSCALE_HEADER
-_ACEOF
+AVCODEC_REQUIRED=$AVCODEC_VERSION
+ if test x$have_libavcodec = xtrue; then
+ HAVE_LIBAVCODEC_TRUE=
+ HAVE_LIBAVCODEC_FALSE='#'
+else
+ HAVE_LIBAVCODEC_TRUE='#'
+ HAVE_LIBAVCODEC_FALSE=
fi
@@ -17072,6 +17150,8 @@
+
+
have_libpng=false
PNG_REQUIRED="1.2.23"
@@ -18141,14 +18221,14 @@
as_fn_error "conditional \"HAVE_LIBJPEG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${HAVE_LIBAVCODEC_TRUE}" && test -z "${HAVE_LIBAVCODEC_FALSE}"; then
- as_fn_error "conditional \"HAVE_LIBAVCODEC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_LIBSWSCALE_TRUE}" && test -z "${HAVE_LIBSWSCALE_FALSE}"; then
as_fn_error "conditional \"HAVE_LIBSWSCALE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_LIBAVCODEC_TRUE}" && test -z "${HAVE_LIBAVCODEC_FALSE}"; then
+ as_fn_error "conditional \"HAVE_LIBAVCODEC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_LIBPNG_TRUE}" && test -z "${HAVE_LIBPNG_FALSE}"; then
as_fn_error "conditional \"HAVE_LIBPNG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/configure.ac
^
|
@@ -1,5 +1,5 @@
AC_INIT(src/lqt_quicktime.c)
-AM_INIT_AUTOMAKE(libquicktime, 1.2.3)
+AM_INIT_AUTOMAKE(libquicktime, 1.2.4)
LQT_VERSION=$VERSION
@@ -42,17 +42,14 @@
LQT_CODEC_API_VERSION="12"
AH_TEMPLATE([HAVE_GPL], [Enable GPL code])
-
-AC_DEFINE_UNQUOTED(LQT_CODEC_API_VERSION, $LQT_CODEC_API_VERSION)
+AH_TEMPLATE([LQT_CODEC_API_VERSION],
+ [Libquicktime codec API version])
if test "x$have_gpl" = "xtrue"; then
LQT_CODEC_API_VERSION="($LQT_CODEC_API_VERSION|0x10000)"
AC_DEFINE(HAVE_GPL)
fi
-AH_TEMPLATE([LQT_CODEC_API_VERSION],
- [Libquicktime codec API version])
-
AC_DEFINE_UNQUOTED(LQT_CODEC_API_VERSION, $LQT_CODEC_API_VERSION)
AC_SUBST(LQT_CODEC_API_VERSION)
@@ -500,37 +497,6 @@
AC_SUBST(JPEG_REQUIRED)
AM_CONDITIONAL(HAVE_LIBJPEG, test x$have_libjpeg = xtrue)
-
-
-dnl
-dnl Check for libavcodec (ffmpeg)
-dnl
-
-AH_TEMPLATE([HAVE_LIBAVCODEC],
- [Do we have libavcodec installed?])
-
-have_libavcodec=false
-
-AVCODEC_BUILD="3277056"
-
-AC_ARG_WITH([ffmpeg], AS_HELP_STRING([--without-ffmpeg], [Build without ffmpeg library (default: test)]))
-
-if test "x$with_ffmpeg" != "xno"; then
-
-dnl PKG_CHECK_MODULES(AVCODEC, avcodec_acl = $AVCODEC_REQUIRED, have_libavcodec="true", have_libavcodec="false")
-ACL_PATH_AVCODEC($AVCODEC_BUILD , have_libavcodec="true", have_libavcodec="false")
-
-
-fi
-
-AVCODEC_REQUIRED=$AVCODEC_VERSION
-
-AM_CONDITIONAL(HAVE_LIBAVCODEC, test x$have_libavcodec = xtrue)
-
-AC_SUBST(AVCODEC_REQUIRED)
-AC_SUBST(AVCODEC_LIBS)
-AC_SUBST(AVCODEC_CFLAGS)
-
dnl
dnl libswscale
dnl
@@ -590,6 +556,33 @@
dnl
+dnl Check for libavcodec (ffmpeg)
+dnl
+
+AH_TEMPLATE([HAVE_LIBAVCODEC],
+ [Do we have libavcodec installed?])
+
+have_libavcodec=false
+
+AVCODEC_BUILD="3412992"
+
+AC_ARG_WITH([ffmpeg], AS_HELP_STRING([--without-ffmpeg], [Build without ffmpeg library (default: test)]))
+
+if test "x$with_ffmpeg" != "xno"; then
+
+ACL_PATH_AVCODEC($AVCODEC_BUILD , have_libavcodec="true", have_libavcodec="false")
+
+fi
+
+AVCODEC_REQUIRED=$AVCODEC_VERSION
+
+AM_CONDITIONAL(HAVE_LIBAVCODEC, test x$have_libavcodec = xtrue)
+
+AC_SUBST(AVCODEC_REQUIRED)
+AC_SUBST(AVCODEC_LIBS)
+AC_SUBST(AVCODEC_CFLAGS)
+
+dnl
dnl Check for libpng
dnl
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/cmodel_permutation.h
^
|
@@ -208,6 +208,28 @@
}
+static inline void transfer_RGB888_to_YUV422P10(uint16_t *output_y,
+ uint16_t *output_u,
+ uint16_t *output_v,
+ unsigned char *input,
+ int output_column)
+{
+ RGB_24_TO_YUV_10(input[0], input[1], input[2],
+ output_y[output_column], output_u[output_column/2], output_v[output_column/2]);
+
+}
+
+static inline void transfer_RGB888_to_YUVJ422P10(uint16_t *output_y,
+ uint16_t *output_u,
+ uint16_t *output_v,
+ unsigned char *input,
+ int output_column)
+{
+ RGB_24_TO_YUVJ_10(input[0], input[1], input[2],
+ output_y[output_column], output_u[output_column/2], output_v[output_column/2]);
+
+}
+
static inline void transfer_RGB888_to_YUV411P(unsigned char *output_y,
unsigned char *output_u,
unsigned char *output_v,
@@ -763,6 +785,36 @@
output_v[output_column] = v;
}
+static inline void transfer_RGB161616_to_YUV422P10(uint16_t *output_y,
+ uint16_t *output_u,
+ uint16_t *output_v,
+ uint16_t *input,
+ int output_column)
+{
+ int y, u, v;
+
+ RGB_48_TO_YUV_10(input[0], input[1], input[2], y, u, v);
+
+ output_y[output_column] = y;
+ output_u[output_column / 2] = u;
+ output_v[output_column / 2] = v;
+}
+
+static inline void transfer_RGB161616_to_YUVJ422P10(uint16_t *output_y,
+ uint16_t *output_u,
+ uint16_t *output_v,
+ uint16_t *input,
+ int output_column)
+{
+ int y, u, v;
+
+ RGB_48_TO_YUVJ_10(input[0], input[1], input[2], y, u, v);
+
+ output_y[output_column] = y;
+ output_u[output_column / 2] = u;
+ output_v[output_column / 2] = v;
+}
+
// ****************************** RGBA16161616 -> *****************************
@@ -1458,6 +1510,50 @@
output_v[j / 2] = UV_16_TO_UV_8(*input_v);
}
+// ******************************** YUV422P10 -> ********************************
+
+static inline void transfer_YUV422P10_to_RGB888(unsigned char *(*output),
+ uint16_t *input_y,
+ uint16_t *input_u,
+ uint16_t *input_v)
+{
+ int i_tmp;
+ YUV_10_TO_RGB_24(*input_y, *input_u, *input_v, (*output)[0], (*output)[1], (*output)[2])
+ (*output) += 3;
+}
+
+static inline void transfer_YUV422P10_to_RGB161616(uint16_t *(*output),
+ uint16_t *input_y,
+ uint16_t *input_u,
+ uint16_t *input_v)
+{
+ int i_tmp;
+ YUV_10_TO_RGB_48(*input_y, *input_u, *input_v, (*output)[0], (*output)[1], (*output)[2])
+ (*output) += 3;
+}
+
+// ******************************** YUVJ422P10 -> ********************************
+
+static inline void transfer_YUVJ422P10_to_RGB888(unsigned char *(*output),
+ uint16_t *input_y,
+ uint16_t *input_u,
+ uint16_t *input_v)
+{
+ int i_tmp;
+ YUVJ_10_TO_RGB_24(*input_y, *input_u, *input_v, (*output)[0], (*output)[1], (*output)[2])
+ (*output) += 3;
+}
+
+static inline void transfer_YUVJ422P10_to_RGB161616(uint16_t *(*output),
+ uint16_t *input_y,
+ uint16_t *input_u,
+ uint16_t *input_v)
+{
+ int i_tmp;
+ YUVJ_10_TO_RGB_48(*input_y, *input_u, *input_v, (*output)[0], (*output)[1], (*output)[2])
+ (*output) += 3;
+}
+
// ******************************** YUV444P16 -> ********************************
static inline void transfer_YUV444P16_to_RGB888(unsigned char *(*output),
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/colorspace_macros.h
^
|
@@ -23,6 +23,7 @@
*******************************************************************************/
#define RECLIP_8(color) (uint8_t)((color>0xFF)?0xff:((color<0)?0:color))
+#define RECLIP_10(color) (uint16_t)((color>0x03FF)?0x03FF:((color<0)?0:color))
#define RECLIP_16(color) (uint16_t)((color>0xFFFF)?0xFFFF:((color<0)?0:color))
#define RECLIP_FLOAT(color) ((color>1.0)?1.0:((color<0.0)?0.0:color))
@@ -172,6 +173,18 @@
u=(r_to_u[r]+g_to_u[g]+b_to_u[b])>>8; \
v=(r_to_v[r]+g_to_v[g]+b_to_v[b])>>8;
+/* 24 -> 10 */
+
+#define RGB_24_TO_YUV_10(r,g,b,y,u,v) \
+ y=RECLIP_10((r_to_y[r]+g_to_y[g]+b_to_y[b])>>14); \
+ u=RECLIP_10((r_to_u[r]+g_to_u[g]+b_to_u[b])>>14); \
+ v=RECLIP_10((r_to_v[r]+g_to_v[g]+b_to_v[b])>>14);
+
+#define RGB_24_TO_YUVJ_10(r,g,b,y,u,v) \
+ y=RECLIP_10((r_to_yj[r]+g_to_yj[g]+b_to_yj[b])>>14); \
+ u=RECLIP_10((r_to_uj[r]+g_to_uj[g]+b_to_uj[b])>>14); \
+ v=RECLIP_10((r_to_vj[r]+g_to_vj[g]+b_to_vj[b])>>14);
+
/* 48 -> 8 */
#define r_16_to_y (int64_t)((0.29900*219.0/255.0)*0x10000)
@@ -224,6 +237,16 @@
u=(r_16_to_u * r + g_16_to_u * g + b_16_to_u * b + 0x80000000LL)>>16; \
v=(r_16_to_v * r + g_16_to_v * g + b_16_to_v * b + 0x80000000LL)>>16;
+#define RGB_48_TO_YUV_10(r,g,b,y,u,v) \
+ y=RECLIP_10(((r_16_to_y * r + g_16_to_y * g + b_16_to_y * b)>>22) + 0x040LL); \
+ u=RECLIP_10(((r_16_to_u * r + g_16_to_u * g + b_16_to_u * b)>>22) + 0x200LL); \
+ v=RECLIP_10(((r_16_to_v * r + g_16_to_v * g + b_16_to_v * b)>>22) + 0x200LL);
+
+#define RGB_48_TO_YUVJ_10(r,g,b,y,u,v) \
+ y=RECLIP_10((r_16_to_yj * r + g_16_to_yj * g + b_16_to_yj * b)>>22); \
+ u=RECLIP_10(((r_16_to_uj * r + g_16_to_uj * g + b_16_to_uj * b)>>22) + 0x200LL); \
+ v=RECLIP_10(((r_16_to_vj * r + g_16_to_vj * g + b_16_to_vj * b)>>22) + 0x200LL);
+
/* RGB Float -> YUV */
#define r_float_to_y 0.29900
@@ -328,10 +351,15 @@
/* YUV (16 bit) -> 8 */
#define y_16_to_rgb (int64_t)(255.0/219.0 * 0x10000)
-#define v_16_to_r (int64_t)( 1.40200*255.0/224.0 * 0x10000)
-#define u_16_to_g (int64_t)(-0.34414*255.0/224.0 * 0x10000)
-#define v_16_to_g (int64_t)(-0.71414*255.0/224.0 * 0x10000)
-#define u_16_to_b (int64_t)( 1.77200*255.0/224.0 * 0x10000)
+#define yj_16_to_rgb (int64_t)0x10000
+#define v_16_to_r (int64_t)( 1.40200*255.0/224.0 * 0x10000)
+#define vj_16_to_r (int64_t)( 1.40200 * 0x10000)
+#define u_16_to_g (int64_t)(-0.34414*255.0/224.0 * 0x10000)
+#define uj_16_to_g (int64_t)(-0.34414 * 0x10000)
+#define v_16_to_g (int64_t)(-0.71414*255.0/224.0 * 0x10000)
+#define vj_16_to_g (int64_t)(-0.71414 * 0x10000)
+#define u_16_to_b (int64_t)( 1.77200*255.0/224.0 * 0x10000)
+#define uj_16_to_b (int64_t)( 1.77200 * 0x10000)
#define YUV_16_TO_RGB_24(y,u,v,r,g,b) \
i_tmp=(y_16_to_rgb * (y-0x1000) + v_16_to_r * (v-0x8000))>>24; \
@@ -341,6 +369,24 @@
i_tmp=(y_16_to_rgb * (y-0x1000) + u_16_to_b * (u-0x8000))>>24; \
b = RECLIP_8(i_tmp);
+/* YUV (10 bit) -> 8 */
+
+#define YUV_10_TO_RGB_24(y,u,v,r,g,b) \
+ i_tmp=(yj_16_to_rgb * (y-0x40) + vj_16_to_r * (v-0x200))>>18; \
+ r = RECLIP_8(i_tmp);\
+ i_tmp=(yj_16_to_rgb * (y-0x40) + uj_16_to_g * (u-0x200)+ vj_16_to_g * (v-0x200))>>18; \
+ g = RECLIP_8(i_tmp);\
+ i_tmp=(yj_16_to_rgb * (y-0x40) + uj_16_to_b * (u-0x200))>>18; \
+ b = RECLIP_8(i_tmp);
+
+#define YUVJ_10_TO_RGB_24(y,u,v,r,g,b) \
+ i_tmp=(yj_16_to_rgb * y + vj_16_to_r * (v-0x200))>>18; \
+ r = RECLIP_8(i_tmp);\
+ i_tmp=(yj_16_to_rgb * y + uj_16_to_g * (u-0x200)+ vj_16_to_g * (v-0x200))>>18; \
+ g = RECLIP_8(i_tmp);\
+ i_tmp=(yj_16_to_rgb * y + uj_16_to_b * (u-0x200))>>18; \
+ b = RECLIP_8(i_tmp);
+
/* YUV (16 bit) -> 16 */
@@ -352,6 +398,24 @@
i_tmp=(y_16_to_rgb * (y-0x1000) + u_16_to_b * (u-0x8000))>>16; \
b = RECLIP_16(i_tmp);
+/* YUV (10 bit) -> 16 */
+
+#define YUV_10_TO_RGB_48(y,u,v,r,g,b) \
+ i_tmp=(y_16_to_rgb * (y-0x40) + v_16_to_r * (v-0x200))>>10; \
+ r = RECLIP_16(i_tmp);\
+ i_tmp=(y_16_to_rgb * (y-0x40) + u_16_to_g * (u-0x200)+ v_16_to_g * (v-0x200))>>10; \
+ g = RECLIP_16(i_tmp);\
+ i_tmp=(y_16_to_rgb * (y-0x40) + u_16_to_b * (u-0x200))>>10; \
+ b = RECLIP_16(i_tmp);
+
+#define YUVJ_10_TO_RGB_48(y,u,v,r,g,b) \
+ i_tmp=(yj_16_to_rgb * y + vj_16_to_r * (v-0x200))>>10; \
+ r = RECLIP_16(i_tmp);\
+ i_tmp=(yj_16_to_rgb * y + uj_16_to_g * (u-0x200)+ vj_16_to_g * (v-0x200))>>10; \
+ g = RECLIP_16(i_tmp);\
+ i_tmp=(yj_16_to_rgb * y + uj_16_to_b * (u-0x200))>>10; \
+ b = RECLIP_16(i_tmp);
+
/* YUV (16 bit) -> float */
#define y_16_to_rgb_float (255.0/219.0/65535.0)
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/lqt_funcprotos.h
^
|
@@ -403,6 +403,11 @@
void quicktime_elst_dump(quicktime_elst_t *elst);
void quicktime_read_elst(quicktime_t *file, quicktime_elst_t *elst);
void quicktime_write_elst(quicktime_t *file, quicktime_elst_t *elst);
+void quicktime_elst_fix_counts(quicktime_elst_t *elst,
+ int moov_scale, quicktime_trak_t * trak, int timescale);
+int64_t quicktime_elst_get_pts_offset(quicktime_elst_t *elst,
+ int moov_scale, int timescale);
+
/* esds.c */
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/quicktime/colormodels.h
^
|
@@ -178,6 +178,19 @@
#define BC_YUV444P16 22
+/** \ingroup color
+
+ 10 bit values in uint16_t native byte order containers, planar YCbCr 4:2:2.
+*/
+#define BC_YUV422P10 23
+
+/** \ingroup color
+
+ 10 bit values in uint16_t native byte order containers, planar YCbCr 4:2:2.
+ Luma and chroma values are full range (0 .. 1023)
+*/
+#define BC_YUVJ422P10 24
+
// Colormodels purely used by Quicktime are done in Quicktime.
// For communication with the X Server
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/quicktime/lqt.h
^
|
@@ -1031,6 +1031,15 @@
const char * stats_file, int track);
/** \ingroup video_decode
+ * \brief Get the timestamp of a given frame
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param frame The frame
+ * \returns The timestamp of the frame
+ */
+int64_t lqt_get_frame_time(quicktime_t * file, int track, int frame);
+
+/** \ingroup video_decode
* \brief Get the timestamp of the next frame to be decoded
* \param file A quicktime handle
* \param track Track index (starting with 0)
@@ -1160,10 +1169,45 @@
* you should verify, that this colormodel can be used with
* \ref quicktime_reads_cmodel (for reading), \ref quicktime_writes_cmodel
* (for writing) or \ref lqt_get_best_colormodel (for reading and writing).
- */
+ */
void lqt_set_cmodel(quicktime_t *file, int track, int colormodel);
+/** \ingroup video_decode
+ * \brief Get the number of video track edit segments
+ * \param file A quicktime handle
+ * \param track Video track index (starting with 0)
+ */
+
+long lqt_video_edit_list_total_entries(quicktime_t * file, int track);
+
+/** \ingroup video_decode
+ * \brief Get the duration of a video track edit segment
+ * \param file A quicktime handle
+ * \param track Video track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+long lqt_video_edit_duration(quicktime_t * file, int track, int entry_index);
+
+/** \ingroup video_decode
+ * \brief Get the time offset of a video track edit segment
+ * \param file A quicktime handle
+ * \param track Video track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+long lqt_video_edit_time(quicktime_t * file, int track, int entry_index);
+
+/** \ingroup video_decode
+ * \brief Get the rate of a video track edit segment
+ * \param file A quicktime handle
+ * \param track Video track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+float lqt_video_edit_rate(quicktime_t * file, int track, int entry_index);
+
/** \ingroup video
* \brief Set the row span for the luma plane
* \param file A quicktime handle
@@ -1378,6 +1422,41 @@
void lqt_seek_video(quicktime_t * file, int track,
int64_t time);
+/** \ingroup audio_decode
+ * \brief Get the number of audio track edit segments
+ * \param file A quicktime handle
+ * \param track Audio track index (starting with 0)
+ */
+
+long lqt_audio_edit_list_total_entries(quicktime_t * file, int track);
+
+/** \ingroup audio_decode
+ * \brief Get the duration of a audio track edit segment
+ * \param file A quicktime handle
+ * \param track Audio track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+long lqt_audio_edit_duration(quicktime_t * file, int track, int entry_index);
+
+/** \ingroup audio_decode
+ * \brief Get the time offset of a audio track edit segment
+ * \param file A quicktime handle
+ * \param track Audio track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+long lqt_audio_edit_time(quicktime_t * file, int track, int entry_index);
+
+/** \ingroup audio_decode
+ * \brief Get the rate of a audio track edit segment
+ * \param file A quicktime handle
+ * \param track Audio track index (starting with 0)
+ * \param entry_index Index into the edit segments
+ */
+
+float lqt_audio_edit_rate(quicktime_t * file, int track, int entry_index);
+
/*
* AVI Specific stuff
*/
@@ -1602,8 +1681,60 @@
void lqt_set_max_riff_size(quicktime_t * file, int size);
+
+/** \ingroup audio_encode
+ * \brief Set an audio pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS of the first audio sample (in samples)
+ */
+
+void lqt_set_audio_pts_offset(quicktime_t * file, int track, int64_t offset);
+/** \ingroup audio_decode
+ * \brief Get an audio pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS of the first audio sample (in samples)
+ */
+
+int64_t lqt_get_audio_pts_offset(quicktime_t * file, int track);
+
+/** \ingroup video_encode
+ * \brief Set an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS of the first video frame (in timescale units)
+ */
+
+void lqt_set_video_pts_offset(quicktime_t * file, int track, int64_t offset);
+/** \ingroup video_decode
+ * \brief Get an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS of the first video frame (in timescale units)
+ */
+
+int64_t lqt_get_video_pts_offset(quicktime_t * file, int track);
+
+/** \ingroup text_encode
+ * \brief Set an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS offset of the subtitles (in timescale units)
+ */
+
+void lqt_set_text_pts_offset(quicktime_t * file, int track, int64_t offset);
+
+/** \ingroup text_decode
+ * \brief Get an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS offset of the subtitles (in timescale units)
+ */
+
+int64_t lqt_get_text_pts_offset(quicktime_t * file, int track);
#ifdef __cplusplus
}
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/include/quicktime/qtprivate.h
^
|
@@ -852,8 +852,8 @@
/* edit list */
typedef struct
{
- long duration;
- long time;
+ uint32_t duration;
+ int32_t time;
float rate;
} quicktime_elst_table_t;
@@ -919,6 +919,8 @@
int chunk_num;
int chunk_samples;
+ int64_t pts_offset;
+
} quicktime_trak_t;
@@ -996,7 +998,7 @@
typedef struct
{
/* Offset of end of 8 byte chunk header relative to ix->base_offset */
- int relative_offset;
+ uint32_t relative_offset;
/* size of data without 8 byte header */
uint32_t size;
} quicktime_ixtable_t;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/m4/avcodec.m4
^
|
@@ -8,27 +8,24 @@
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
+CFLAGS="$GMERLIN_DEP_CFLAGS $CFLAGS $AVCODEC_CFLAGS"
+LIBS="$GMERLIN_DEP_LIBS $AVCODEC_LIBS"
+
AVCODEC_HEADER=""
dnl Look for header
found_header="false"
-AC_TRY_COMPILE([
-#include <libavcodec/avcodec.h>],[], [found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>" ],)
+AC_TRY_COMPILE([#include <libavcodec/avcodec.h>],[],[found_header="true";AVCODEC_HEADER="<libavcodec/avcodec.h>";VDPAU_HEADER="<libavcodec/vdpau.h>" ],)
if test $found_header = "false"; then
-AC_TRY_COMPILE([
-#include <avcodec.h>],[],[found_header="true";AVCODEC_HEADER="<avcodec.h>"])
+AC_TRY_COMPILE([#include <avcodec.h>],[],[found_header="true";AVCODEC_HEADER="<avcodec.h>";VDPAU_HEADER="<vdpau.h>"])
fi
if test $found_header = "false"; then
-AC_TRY_COMPILE([
-#include <ffmpeg/avcodec.h>],[], [found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>" ],)
+AC_TRY_COMPILE([#include <ffmpeg/avcodec.h>],[], [found_header="true";AVCODEC_HEADER="<ffmpeg/avcodec.h>";VDPAU_HEADER="<vdpau.h>" ],)
fi
-CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
-LIBS="$LIBS $AVCODEC_LIBS"
avcodec_ok="false"
AC_TRY_RUN([
#include <stdio.h>
@@ -57,6 +54,31 @@
# program could not be run
AC_MSG_RESULT(failed)
])
+
+have_avcodec_img_convert="false"
+
+if test "x$avcodec_ok" = "xtrue"; then
+
+avcodec_swscale_missing="false"
+
+dnl AC_CHECK_HEADERS([libavcore/avcore.h])
+
+AC_MSG_CHECKING(for img_convert)
+AC_TRY_LINK([#include <avcodec.h>],
+ [img_convert(NULL, 0, NULL, 0, 0, 0);
+ return 0;],
+ have_avcodec_img_convert=true
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+
+if test "x$have_avcodec_img_convert" != "xtrue"; then
+ if test "x$have_libswscale" != "xtrue"; then
+ avcodec_swscale_missing="true"
+ avcodec_ok="false"
+ fi
+fi
+
+fi
+
CFLAGS="$CFLAGS_save"
LIBS="$LIBS_save"
])
@@ -75,6 +97,8 @@
AH_TEMPLATE([AVCODEC_HEADER],
[Header for libavcodec])
+AH_TEMPLATE([VDPAU_HEADER],
+ [Header for vdpau])
dnl
dnl First preference: configure options
@@ -95,6 +119,15 @@
if test "x$avcodec_done" = "xfalse"; then
PKG_CHECK_MODULES(AVCODEC, libavcodec, avcodec_orig="true", avcodec_orig="false")
+
+dnl
+dnl No idea for what this is good but libavcodec is not found if this is missing
+dnl
+
+ if test "x$os_win32" = "xyes"; then
+ AVCODEC_LIBS="-L/usr/local/bin $AVCODEC_LIBS"
+ fi
+
ACL_CHECK_AVCODEC([$1])
if test "x$avcodec_ok" = "xtrue"; then
avcodec_done="true"
@@ -104,6 +137,7 @@
if test "x$avcodec_done" = "xtrue"; then
ifelse([$2], , :, [$2])
AC_DEFINE_UNQUOTED(AVCODEC_HEADER, $AVCODEC_HEADER)
+ AC_DEFINE_UNQUOTED(VDPAU_HEADER, $VDPAU_HEADER)
else
ifelse([$3], , :, [$3])
fi
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/audiocodec/pcm.c
^
|
@@ -991,6 +991,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
/* Init private items */
codec = calloc(1, sizeof(*codec));
@@ -1038,6 +1039,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
// codec_base->wav_id = 0x01;
/* Init private items */
@@ -1171,6 +1173,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
/* Init private items */
codec = calloc(1, sizeof(*codec));
@@ -1234,6 +1237,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
/* Init private items */
codec = calloc(1, sizeof(*codec));
@@ -1288,6 +1292,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
/* Init private items */
codec = calloc(1, sizeof(*codec));
@@ -1320,7 +1325,8 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
-
+ codec_base->set_parameter = set_parameter_pcm;
+
/* Init private items */
codec = calloc(1, sizeof(*codec));
codec_base->priv = codec;
@@ -1377,6 +1383,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
codec_base->writes_compressed = writes_compressed_aulaw;
/* Init private items */
@@ -1405,6 +1412,7 @@
codec_base->delete_codec = delete_pcm;
codec_base->decode_audio = decode_pcm;
codec_base->encode_audio = encode_pcm;
+ codec_base->set_parameter = set_parameter_pcm;
codec_base->writes_compressed = writes_compressed_aulaw;
/* Init private items */
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/ffmpeg/audio.c
^
|
@@ -31,12 +31,18 @@
#define LOG_DOMAIN "ffmpeg_audio"
-/* Different decoding functions */
+#if LIBAVCODEC_BUILD >= ((53<<16)+(25<<8)+0)
+#define DECODE_AUDIO4 1
+#elif LIBAVCODEC_BUILD >= ((52<<16)+(23<<8)+0)
+#define DECODE_AUDIO3 1
+#else
+#define DECODE_AUDIO2 1
+#endif
-#if LIBAVCODEC_BUILD >= ((51<<16)+(29<<8)+0)
-#define DECODE_FUNC avcodec_decode_audio2
+#if LIBAVCODEC_BUILD >= ((53<<16)+(34<<8)+0)
+#define ENCODE_AUDIO2 1
#else
-#define DECODE_FUNC avcodec_decode_audio
+#define ENCODE_AUDIO 1
#endif
/* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
@@ -445,7 +451,9 @@
int64_t pts; /* For reading compressed packets */
int header_written;
-
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ AVDictionary * options;
+#endif
} quicktime_ffmpeg_audio_codec_t;
static int lqt_ffmpeg_delete_audio(quicktime_codec_t *codec_base)
@@ -462,7 +470,11 @@
if(codec->chunk_buffer)
free(codec->chunk_buffer);
if(codec->extradata)
- free(codec->extradata);
+ free(codec->extradata);
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ if(codec->options)
+ av_dict_free(&codec->options);
+#endif
free(codec);
return 0;
}
@@ -473,7 +485,11 @@
const void *value)
{
quicktime_ffmpeg_audio_codec_t *codec = file->atracks[track].codec->priv;
- lqt_ffmpeg_set_parameter(codec->avctx, key, value);
+ lqt_ffmpeg_set_parameter(codec->avctx,
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ &codec->options,
+#endif
+ key, value);
return 0;
}
@@ -489,6 +505,11 @@
quicktime_audio_map_t *track_map = &file->atracks[track];
quicktime_ffmpeg_audio_codec_t *codec = track_map->codec->priv;
+#if DECODE_AUDIO4
+ AVFrame f;
+ int got_frame;
+#endif
+
chunk_packets = lqt_audio_num_vbr_packets(file, track, track_map->cur_chunk, &num_samples);
if(!chunk_packets)
@@ -513,38 +534,57 @@
if(!packet_size)
return 0;
-#if LIBAVCODEC_BUILD >= 3349760
bytes_decoded = codec->sample_buffer_alloc -
(codec->sample_buffer_end - codec->sample_buffer_start);
bytes_decoded *= 2 * track_map->channels;
-#else
- bytes_decoded = 0;
-#endif
-#if LIBAVCODEC_BUILD >= ((52<<16)+(26<<8)+0)
+#if DECODE_AUDIO3 || DECODE_AUDIO4
codec->pkt.data = codec->chunk_buffer;
codec->pkt.size = packet_size + FF_INPUT_BUFFER_PADDING_SIZE;
+
+#if DECODE_AUDIO4
+ frame_bytes = avcodec_decode_audio4(codec->avctx, &f,
+ &got_frame, &codec->pkt);
+ if(frame_bytes < 0)
+ {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio4 error");
+ break;
+ }
+ bytes_decoded = f.nb_samples * 2 * track_map->channels;
+ memcpy(&codec->sample_buffer[track_map->channels *
+ (codec->sample_buffer_end -
+ codec->sample_buffer_start)],
+ f.extended_data[0],
+ bytes_decoded);
+#else // DECODE_AUDIO3
frame_bytes = avcodec_decode_audio3(codec->avctx,
&codec->sample_buffer[track_map->channels *
(codec->sample_buffer_end -
codec->sample_buffer_start)],
&bytes_decoded,
&codec->pkt);
-#else
+ if(frame_bytes < 0)
+ {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio3 error");
+ break;
+ }
+#endif // DECODE_AUDIO3
+
+#else // DECODE_AUDIO2
frame_bytes =
- DECODE_FUNC(codec->avctx,
+ avcodec_decode_audio2(codec->avctx,
&codec->sample_buffer[track_map->channels *
(codec->sample_buffer_end - codec->sample_buffer_start)],
&bytes_decoded,
codec->chunk_buffer,
packet_size + FF_INPUT_BUFFER_PADDING_SIZE);
-#endif
if(frame_bytes < 0)
{
- lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio error");
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio2 error");
break;
}
+#endif
codec->sample_buffer_end += (bytes_decoded / (track_map->channels * 2));
}
track_map->cur_chunk++;
@@ -568,6 +608,11 @@
quicktime_audio_map_t *track_map = &file->atracks[track];
quicktime_ffmpeg_audio_codec_t *codec = track_map->codec->priv;
+#if DECODE_AUDIO4
+ AVFrame f;
+ int got_frame;
+#endif
+
/* Read chunk */
chunk_size = lqt_append_audio_chunk(file,
@@ -705,32 +750,50 @@
* size in BYTES.
*/
-#if LIBAVCODEC_BUILD >= 3349760
bytes_decoded = codec->sample_buffer_alloc -
(codec->sample_buffer_end - codec->sample_buffer_start);
bytes_decoded *= 2 * track_map->channels;
-#else
- bytes_decoded = 0;
-#endif
-#if LIBAVCODEC_BUILD >= ((52<<16)+(26<<8)+0)
+#if DECODE_AUDIO3 || DECODE_AUDIO4
codec->pkt.data = &codec->chunk_buffer[bytes_used];
codec->pkt.size = codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE;
+
+#if DECODE_AUDIO4
+ frame_bytes = avcodec_decode_audio4(codec->avctx, &f,
+ &got_frame, &codec->pkt);
+ if(frame_bytes < 0)
+ {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio4 error");
+ break;
+ }
+ bytes_decoded = f.nb_samples * 2 * track_map->channels;
+ memcpy(&codec->sample_buffer[track_map->channels *
+ (codec->sample_buffer_end -
+ codec->sample_buffer_start)],
+ f.extended_data[0],
+ bytes_decoded);
+
+#else // DECODE_AUDIO3
frame_bytes =
avcodec_decode_audio3(codec->avctx,
&codec->sample_buffer[track_map->channels *
(codec->sample_buffer_end - codec->sample_buffer_start)],
&bytes_decoded,
&codec->pkt);
-#else
+
+#endif
+
+
+
+#else // DECODE_AUDIO2
frame_bytes =
- DECODE_FUNC(codec->avctx,
- &codec->sample_buffer[track_map->channels *
- (codec->sample_buffer_end - codec->sample_buffer_start)],
- &bytes_decoded,
- &codec->chunk_buffer[bytes_used],
- codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE);
+ avcodec_decode_audio2(codec->avctx,
+ &codec->sample_buffer[track_map->channels *
+ (codec->sample_buffer_end - codec->sample_buffer_start)],
+ &bytes_decoded,
+ &codec->chunk_buffer[bytes_used],
+ codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE);
#endif
if(frame_bytes < 0)
{
@@ -957,12 +1020,20 @@
codec->avctx->codec_id = codec->decoder->id;
codec->avctx->codec_type = codec->decoder->type;
-
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
if(avcodec_open(codec->avctx, codec->decoder) != 0)
{
- lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "Avcodec open failed");
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_open failed");
+ return 0;
+ }
+#else
+ if(avcodec_open2(codec->avctx, codec->decoder, NULL) != 0)
+ {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_open2 failed");
return 0;
}
+#endif
// codec->sample_buffer_offset = 0;
codec->initialized = 1;
@@ -1108,7 +1179,7 @@
static int lqt_ffmpeg_encode_audio(quicktime_t *file, void * input,
- long samples, int track)
+ long samples, int track)
{
int result = -1;
quicktime_audio_map_t *track_map = &file->atracks[track];
@@ -1119,7 +1190,12 @@
int samples_done = 0;
int samples_encoded;
/* Initialize encoder */
-
+#if ENCODE_AUDIO2
+ AVFrame f;
+ AVPacket pkt;
+ int got_packet;
+#endif
+
if(!codec->initialized)
{
codec->avctx->sample_rate = track_map->samplerate;
@@ -1128,11 +1204,22 @@
codec->avctx->codec_id = codec->encoder->id;
codec->avctx->codec_type = codec->encoder->type;
+ codec->avctx->sample_fmt = codec->encoder->sample_fmts[0];
+
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
if(avcodec_open(codec->avctx, codec->encoder) != 0)
{
- lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "Avcodec open failed");
- return -1;
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_open failed");
+ return 0;
+ }
+#else
+ if(avcodec_open2(codec->avctx, codec->encoder, NULL) != 0)
+ {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_open2 failed");
+ return 0;
}
+#endif
codec->initialized = 1;
@@ -1169,21 +1256,38 @@
while(codec->samples_in_buffer >= codec->avctx->frame_size)
{
-
+#if ENCODE_AUDIO2
+ av_init_packet(&pkt);
+ pkt.data = codec->chunk_buffer;
+ pkt.size = codec->chunk_buffer_alloc;
+
+ avcodec_get_frame_defaults(&f);
+ f.nb_samples = codec->avctx->frame_size;
+
+ avcodec_fill_audio_frame(&f, channels, codec->avctx->sample_fmt,
+ (uint8_t*)&codec->sample_buffer[samples_done*channels],
+ codec->avctx->frame_size * channels * 2,
+ 1);
+
+ if(avcodec_encode_audio2(codec->avctx, &pkt,
+ &f, &got_packet) < 0)
+ return 0;
+
+ if(got_packet && pkt.size)
+ frame_bytes = pkt.size;
+ else
+ frame_bytes = 0;
+
+#else
frame_bytes = avcodec_encode_audio(codec->avctx, codec->chunk_buffer,
codec->chunk_buffer_alloc,
&codec->sample_buffer[samples_done*channels]);
+#endif
+
if(frame_bytes > 0)
{
quicktime_write_chunk_header(file, trak);
-#if 0 // PATCH 3
- if(codec->avctx->frame_size == 1)
- samples_encoded = codec->samples_in_buffer;
- else
-#endif
- samples_encoded = codec->avctx->frame_size;
-
-
+ samples_encoded = codec->avctx->frame_size;
samples_done += samples_encoded;
codec->samples_in_buffer -= samples_encoded;
@@ -1262,7 +1366,9 @@
return 1;
}
-static int writes_compressed_mp2(lqt_file_type_t type, const lqt_compression_info_t * ci)
+#if 0
+static int writes_compressed_mp2(lqt_file_type_t type,
+ const lqt_compression_info_t * ci)
{
return 1;
}
@@ -1273,7 +1379,6 @@
return 0;
}
-#if 0
static int init_compressed_ac3(quicktime_t * file, int track)
{
@@ -1297,7 +1402,7 @@
}
quicktime_write_chunk_header(file, atrack->track);
- result = quicktime_write_data(file, p->data, p->data_len);
+ result = !quicktime_write_data(file, p->data, p->data_len);
atrack->track->chunk_samples = p->duration;
quicktime_write_chunk_footer(file, atrack->track);
@@ -1369,14 +1474,18 @@
{
quicktime_ffmpeg_audio_codec_t *codec;
- avcodec_init();
+ // avcodec_init();
codec = calloc(1, sizeof(*codec));
if(!codec)
return;
codec->encoder = encoder;
codec->decoder = decoder;
- codec-> avctx = avcodec_alloc_context();
+#if LIBAVCODEC_VERSION_INT < ((53<<16)|(8<<8)|0)
+ codec->avctx = avcodec_alloc_context();
+#else
+ codec->avctx = avcodec_alloc_context3(NULL);
+#endif
codec_base->priv = (void *)codec;
codec_base->delete_codec = lqt_ffmpeg_delete_audio;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/ffmpeg/ffmpeg.h
^
|
@@ -35,7 +35,11 @@
quicktime_audio_map_t *vtrack,
AVCodec *encoder, AVCodec *decoder);
-void lqt_ffmpeg_set_parameter(AVCodecContext * ctx, const char * key,
+void lqt_ffmpeg_set_parameter(AVCodecContext * ctx,
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ AVDictionary ** options,
+#endif
+ const char * key,
const void * value);
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/ffmpeg/lqt_ffmpeg.c
^
|
@@ -813,7 +813,7 @@
.wav_ids = { LQT_WAV_ID_NONE },
.compatibility_flags = LQT_FILE_QT,
.do_encode = 1,
- .encoding_colormodels = (int[]){ BC_YUV422P, BC_YUVJ422P, LQT_COLORMODEL_NONE }
+ .encoding_colormodels = (int[]){ BC_YUV422P, BC_YUVJ422P, BC_YUV422P10, BC_YUVJ422P10, LQT_COLORMODEL_NONE }
},
#endif
{
@@ -948,7 +948,7 @@
}
avcodec_register_all();
- avcodec_init();
+ // avcodec_init();
ffmpeg_num_video_codecs = 0;
ffmpeg_num_audio_codecs = 0;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/ffmpeg/params.c
^
|
@@ -101,7 +101,17 @@
} \
}
-
+#define PARAM_DICT_FLAG(name, dict_name) \
+ { \
+ if(!strcasecmp(name, key)) \
+ { \
+ char buf[128]; \
+ snprintf(buf, 128, "%d", *(int*)value); \
+ av_dict_set(options, dict_name, buf, 0); \
+ found = 1; \
+ } \
+ }
+
enum_t me_method[] =
{
@@ -166,7 +176,11 @@
}
-void lqt_ffmpeg_set_parameter(AVCodecContext * ctx, const char * key,
+void lqt_ffmpeg_set_parameter(AVCodecContext * ctx,
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ AVDictionary ** options,
+#endif
+ const char * key,
const void * value)
{
int found = 0, i;
@@ -245,11 +259,11 @@
PARAM_FLAG("ff_flag_qpel",CODEC_FLAG_QPEL);
PARAM_FLAG("ff_flag_gmc",CODEC_FLAG_GMC);
PARAM_FLAG("ff_flag_mv0",CODEC_FLAG_MV0);
- PARAM_FLAG("ff_flag_part",CODEC_FLAG_PART);
+ // PARAM_FLAG("ff_flag_part",CODEC_FLAG_PART); // Unused
PARAM_FLAG("ff_flag_gray",CODEC_FLAG_GRAY);
PARAM_FLAG("ff_flag_emu_edge",CODEC_FLAG_EMU_EDGE);
PARAM_FLAG("ff_flag_normalize_aqp",CODEC_FLAG_NORMALIZE_AQP);
- PARAM_FLAG("ff_flag_alt_scan",CODEC_FLAG_ALT_SCAN);
+ // PARAM_FLAG("ff_flag_alt_scan",CODEC_FLAG_ALT_SCAN); // Unused
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
PARAM_FLAG("ff_flag_trellis_quant",CODEC_FLAG_TRELLIS_QUANT);
#else
@@ -257,13 +271,21 @@
#endif
PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
- PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV);
+ // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
+
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
+ PARAM_DICT_FLAG("ff_flag_obmc","obmc");
+ PARAM_DICT_FLAG("ff_flag_h263p_slice_struct","structured_slices");
+#else
PARAM_FLAG("ff_flag_h263p_aiv",CODEC_FLAG_H263P_AIV);
PARAM_FLAG("ff_flag_obmc",CODEC_FLAG_OBMC);
- PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
PARAM_FLAG("ff_flag_h263p_slice_struct",CODEC_FLAG_H263P_SLICE_STRUCT);
+#endif
+
+ PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/ffmpeg/video.c
^
|
@@ -36,8 +36,18 @@
#include SWSCALE_HEADER
#endif
-// Enable interlaced encoding (experimental)
-// #define DO_INTERLACE
+
+#ifdef PIX_FMT_YUV422P10
+#define PIX_FMT_YUV422P10_OR_DUMMY PIX_FMT_YUV422P10
+#else
+#define PIX_FMT_YUV422P10_OR_DUMMY -1234
+#endif
+
+#if LIBAVCODEC_VERSION_INT >= ((54<<16)|(1<<8)|0)
+#define ENCODE_VIDEO2 1
+#else
+#define ENCODE_VIDEO 1
+#endif
/* We keep the numeric values the same as in the ACLR atom.
The interpretation of values is based on trial and error. */
@@ -86,9 +96,17 @@
int is_imx;
int y_offset;
-
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
AVPaletteControl palette;
+#else
+ int palette_sent;
+#endif
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ AVDictionary * options;
+#endif
+
/* We decode the first frame during the init() function to
obtain the stream colormodel */
@@ -125,32 +143,36 @@
}
colormodels[] =
{
- { PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
+ { PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
#if LIBAVUTIL_VERSION_INT < (50<<16)
- { PIX_FMT_YUV422, BC_YUV422, 1 },
+ { PIX_FMT_YUV422, BC_YUV422, 1 },
#else
- { PIX_FMT_YUYV422, BC_YUV422, 1 },
+ { PIX_FMT_YUYV422, BC_YUV422, 1 },
#endif
- { PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB...
- { PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR...
- { PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
- { PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
- { PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
- { PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness
- { PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg)
- { PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg)
- { PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg)
+ { PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB...
+ { PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR...
+ { PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
+ { PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
+ { PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
+ { PIX_FMT_YUV422P16, BC_YUV422P16, 1 }, ///< Planar 16 bit YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
+#ifdef PIX_FMT_YUV422P10
+ { PIX_FMT_YUV422P10, BC_YUV422P10, 1 }, ///< 10 bit samples in uint16_t containers, planar 4:2:2
+#endif
+ { PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness
+ { PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg)
+ { PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg)
+ { PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg)
#if LIBAVUTIL_VERSION_INT < (50<<16)
- { PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA...
+ { PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA...
#else
- { PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA...
+ { PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA...
#endif
- { PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1
- { PIX_FMT_GRAY8, BC_RGB888, 0 },
- { PIX_FMT_MONOWHITE, BC_RGB888, 0 },///< 0 is white
- { PIX_FMT_MONOBLACK, BC_RGB888, 0 },///< 0 is black
- { PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette
- { PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
+ { PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1
+ { PIX_FMT_GRAY8, BC_RGB888, 0 },
+ { PIX_FMT_MONOWHITE, BC_RGB888, 0 }, ///< 0 is white
+ { PIX_FMT_MONOBLACK, BC_RGB888, 0 }, ///< 0 is black
+ { PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette
+ { PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
};
static const struct
@@ -233,6 +255,11 @@
sws_freeContext(codec->swsContext);
#endif
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ if(codec->options)
+ av_dict_free(&codec->options);
+#endif
+
if(codec->tmp_rows)
lqt_rows_free(codec->tmp_rows);
@@ -310,6 +337,21 @@
}
#endif
+static int lqt_tenbit_dnxhd_supported(AVCodec const* codec)
+ {
+ int i;
+ if (!codec->pix_fmts)
+ return 0;
+
+ for (i = 0; codec->pix_fmts[i] != PIX_FMT_NONE; ++i)
+ {
+ if (codec->pix_fmts[i] == PIX_FMT_YUV422P10_OR_DUMMY)
+ return 1;
+ }
+
+ return 0;
+ }
+
static enum PixelFormat lqt_ffmpeg_get_ffmpeg_colormodel(int id)
{
int i;
@@ -360,20 +402,24 @@
/* First we try codec-specific colormodel matching. */
if(codec->decoder->id == CODEC_ID_DNXHD)
{
- /* PIX_FMT_YUV422P is the only pixel format supported by FFMpeg's DNxHD codec,
- at least until they implement 10 bit DNxHD. */
- if (codec->avctx->pix_fmt == PIX_FMT_YUV422P)
+ /* FFMpeg supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 for DNxHD, which
+ we sometimes interpret as PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10. */
+ if (codec->avctx->pix_fmt == PIX_FMT_YUV422P || codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY)
{
+ int p10 = (codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY);
*exact = 1;
if (lqt_ffmpeg_get_avid_yuv_range(vtrack->track) == AVID_FULL_YUV_RANGE)
{
- vtrack->stream_cmodel = BC_YUVJ422P;
- codec->reinterpret_pix_fmt = PIX_FMT_YUVJ422P;
+ vtrack->stream_cmodel = p10 ? BC_YUVJ422P10 : BC_YUVJ422P;
+ codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUVJ422P;
+ // Note: reinterpret_pix_fmt should really be PIX_FMT_YUVJ422P10, except
+ // there is no such colormodel in FFMpeg. Fortunately, it's not a problem
+ // in this case, as reinterpret_pix_fmt is only used when *exact == 0.
}
else
{
- vtrack->stream_cmodel = BC_YUV422P;
- codec->reinterpret_pix_fmt = PIX_FMT_YUV422P;
+ vtrack->stream_cmodel = p10 ? BC_YUV422P10 : BC_YUV422P;
+ codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUV422P;
}
return;
}
@@ -394,8 +440,15 @@
if (codec->encoder->id == CODEC_ID_DNXHD)
{
- /* FFMpeg's DNxHD encoder doesn't know anything about YUVJ422P. */
+ /* FFMpeg's DNxHD encoder only supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10
+ and doesn't know anything about PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10
+ (in fact, the latter doesn't even exist) */
codec->avctx->pix_fmt = PIX_FMT_YUV422P;
+ if (vtrack->stream_cmodel == BC_YUV422P10 || vtrack->stream_cmodel == BC_YUVJ422P10)
+ {
+ if (lqt_tenbit_dnxhd_supported(codec->encoder))
+ codec->avctx->pix_fmt = PIX_FMT_YUV422P10_OR_DUMMY;
+ }
}
}
@@ -736,6 +789,7 @@
/* Add palette info */
ctab = &trak->mdia.minf.stbl.stsd.table->ctab;
+#if LIBAVCODEC_VERSION_MAJOR < 54
if(ctab->size)
{
codec->avctx->palctrl = &codec->palette;
@@ -753,16 +807,28 @@
((ctab->blue[i] >> 8));
}
}
-
+#else
+ /* Palette will be sent later */
+ if(!ctab->size)
+ codec->palette_sent = 1;
+#endif
// codec->avctx->get_buffer = avcodec_default_get_buffer;
// codec->avctx->release_buffer = avcodec_default_release_buffer;
codec->avctx->codec_id = codec->decoder->id;
codec->avctx->codec_type = codec->decoder->type;
-
+
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(112<<8)+0)
avcodec_thread_init(codec->avctx, codec->avctx->thread_count);
+#endif
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
if(avcodec_open(codec->avctx, codec->decoder) != 0)
return -1;
+#else
+ if(avcodec_open2(codec->avctx, codec->decoder, NULL) != 0)
+ return -1;
+#endif
codec->frame = avcodec_alloc_frame();
vtrack->stream_cmodel = LQT_COLORMODEL_NONE;
codec->initialized = 1;
@@ -786,6 +852,32 @@
#if LIBAVCODEC_BUILD >= ((52<<16)+(26<<8)+0)
codec->pkt.data = codec->buffer;
codec->pkt.size = buffer_size;
+
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ if(!codec->palette_sent)
+ {
+ uint32_t * pal_i;
+ ctab = &trak->mdia.minf.stbl.stsd.table->ctab;
+ pal_i =
+ (uint32_t*)av_packet_new_side_data(&codec->pkt, AV_PKT_DATA_PALETTE,
+ AVPALETTE_COUNT * 4);
+ imax =
+ (ctab->size > AVPALETTE_COUNT)
+ ? AVPALETTE_COUNT : ctab->size;
+
+ for(i = 0; i < imax; i++)
+ {
+ pal_i[i] =
+ ((ctab->alpha[i] >> 8) << 24) |
+ ((ctab->red[i] >> 8) << 16) |
+ ((ctab->green[i] >> 8) << 8) |
+ ((ctab->blue[i] >> 8));
+ }
+ for(i = imax; i < AVPALETTE_COUNT; i++)
+ pal_i[i] = 0;
+ }
+#endif
+
if(avcodec_decode_video2(codec->avctx,
codec->frame,
&got_pic,
@@ -794,6 +886,19 @@
lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "Skipping corrupted frame");
continue;
}
+
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ /* Ugly hack: Need to free the side data elements manually because
+ ffmpeg has no public API for that */
+ if(!codec->palette_sent)
+ {
+ av_free(codec->pkt.side_data[0].data);
+ av_freep(&codec->pkt.side_data);
+ codec->pkt.side_data_elems = 0;
+ }
+#endif
+
+
#else
if(avcodec_decode_video(codec->avctx,
@@ -1037,8 +1142,14 @@
codec->avctx->rtp_payload_size = 1; // ??
codec->avctx->rc_buffer_aggressivity = 0.25;
codec->avctx->flags |= CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_LOW_DELAY;
- codec->avctx->flags2 |= CODEC_FLAG2_INTRA_VLC|CODEC_FLAG2_NON_LINEAR_QUANT;
+#if (LIBAVCODEC_VERSION_MAJOR < 54)
+ codec->avctx->flags2 |= CODEC_FLAG2_INTRA_VLC|CODEC_FLAG2_NON_LINEAR_QUANT;
+#else
+ av_dict_set(&codec->options, "non_linear_quant", "1", 0);
+ av_dict_set(&codec->options, "intra_vlc", "1", 0);
+#endif
+
codec->avctx->bit_rate = codec->imx_bitrate * 1000000;
codec->avctx->rc_max_rate = codec->avctx->bit_rate;
@@ -1106,12 +1217,16 @@
}
-static void setup_avid_atoms(quicktime_t* file, quicktime_video_map_t *vtrack, uint8_t const* enc_data, int enc_data_size)
+static void setup_avid_atoms(quicktime_t* file,
+ quicktime_video_map_t *vtrack,
+ uint8_t const* enc_data, int enc_data_size)
{
uint8_t* p;
uint8_t ACLR_atom[16];
uint8_t APRG_atom[16];
uint8_t ARES_atom[112];
+ int full_range_yuv = (vtrack->stream_cmodel == BC_YUVJ422P ||
+ vtrack->stream_cmodel == BC_YUVJ422P10);
if (enc_data_size < 0x2c)
{
@@ -1122,7 +1237,7 @@
p = ACLR_atom;
lqt_ffmpeg_write_tag(&p, "ACLR");
lqt_ffmpeg_write_tag(&p, "0001");
- lqt_ffmpeg_write_be32(&p, vtrack->stream_cmodel == BC_YUVJ422P ? AVID_FULL_YUV_RANGE : AVID_NORMAL_YUV_RANGE);
+ lqt_ffmpeg_write_be32(&p, full_range_yuv ? AVID_FULL_YUV_RANGE : AVID_NORMAL_YUV_RANGE);
lqt_ffmpeg_write_be32(&p, 0); /* unknown */
quicktime_stsd_set_user_atom(vtrack->track, "ACLR", ACLR_atom, sizeof(ACLR_atom));
@@ -1173,6 +1288,13 @@
int height = trak->tkhd.track_height;
int width = trak->tkhd.track_width;
int stats_len;
+#if ENCODE_VIDEO2
+ AVPacket pkt;
+ int got_packet;
+#endif
+ int64_t pts;
+ int kf;
+
if(!row_pointers)
{
if(vtrack->stream_cmodel == BC_YUV420P)
@@ -1180,20 +1302,16 @@
if(codec->encoder->id == CODEC_ID_MPEG4)
{
vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2;
-#ifndef DO_INTERLACE // Seems not to work yet
/* enable interlaced encoding */
vtrack->interlace_mode = LQT_INTERLACE_NONE;
-#endif
}
else if(codec->encoder->id == CODEC_ID_DVVIDEO)
{
vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL;
}
-#ifndef DO_INTERLACE // Seems not to work yet
else
/* enable interlaced encoding */
vtrack->interlace_mode = LQT_INTERLACE_NONE;
-#endif
}
return 0;
}
@@ -1328,9 +1446,17 @@
codec->avctx->codec_id = codec->decoder->id;
codec->avctx->codec_type = codec->decoder->type;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(112<<8)+0)
avcodec_thread_init(codec->avctx, codec->avctx->thread_count);
+#endif
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
if(avcodec_open(codec->avctx, codec->encoder) != 0)
return -1;
+#else
+ if(avcodec_open2(codec->avctx, codec->encoder, &codec->options) != 0)
+ return -1;
+#endif
codec->buffer_alloc = codec->avctx->width * codec->avctx->height * 4 + 1024*256;
codec->buffer = malloc(codec->buffer_alloc);
if(!codec->buffer)
@@ -1399,23 +1525,44 @@
if(vtrack->interlace_mode == LQT_INTERLACE_TOP_FIRST)
codec->frame->top_field_first = 1;
}
-#endif
+#endif
+
+#if ENCODE_VIDEO2 // New
+ av_init_packet(&pkt);
+ pkt.data = codec->buffer;
+ pkt.size = codec->buffer_alloc;
+
+ if(avcodec_encode_video2(codec->avctx, &pkt, codec->frame, &got_packet) < 0)
+ return -1;
+
+ if(got_packet)
+ bytes_encoded = pkt.size;
+ else
+ bytes_encoded = 0;
+
+ pts = pkt.pts;
+ kf = !!(pkt.flags & AV_PKT_FLAG_KEY);
+
+#else // Old
+
bytes_encoded = avcodec_encode_video(codec->avctx,
codec->buffer,
codec->buffer_alloc,
codec->frame);
-
+
if(bytes_encoded < 0)
return -1;
-
+
+ pts = codec->avctx->coded_frame->pts;
+ kf = codec->avctx->coded_frame->key_frame;
+
+#endif
+
if(!was_initialized && codec->encoder->id == CODEC_ID_DNXHD)
- {
setup_avid_atoms(file, vtrack, codec->buffer, bytes_encoded);
- }
-
+
if(bytes_encoded)
{
- int64_t pts = codec->avctx->coded_frame->pts;
if (pts == AV_NOPTS_VALUE || (codec->encoder->id == CODEC_ID_DNXHD && pts == 0))
{
/* Some codecs don't bother generating presentation timestamps.
@@ -1425,7 +1572,7 @@
lqt_write_frame_header(file, track,
-1, (int)pts,
- codec->avctx->coded_frame->key_frame);
+ kf);
result = !quicktime_write_data(file,
codec->buffer,
@@ -1470,25 +1617,54 @@
int bytes_encoded;
quicktime_video_map_t *vtrack = &file->vtracks[track];
quicktime_ffmpeg_video_codec_t *codec = vtrack->codec->priv;
-
+ int64_t pts;
+ int kf;
+
+#if ENCODE_VIDEO2
+ AVPacket pkt;
+ int got_packet;
+#endif
+
/* Do nothing if we didn't encode anything yet */
if(!codec->initialized)
return 0;
-
+
+#if ENCODE_VIDEO2
+ av_init_packet(&pkt);
+ pkt.data = codec->buffer;
+ pkt.size = codec->buffer_alloc;
+
+ if(avcodec_encode_video2(codec->avctx, &pkt, (AVFrame*)0, &got_packet) < 0)
+ return -1;
+
+ if(got_packet)
+ bytes_encoded = pkt.size;
+ else
+ return 0;
+
+ pts = pkt.pts;
+
+ kf = !!(pkt.flags & AV_PKT_FLAG_KEY);
+
+#else
+
bytes_encoded = avcodec_encode_video(codec->avctx,
codec->buffer,
codec->buffer_alloc,
(AVFrame*)0);
-
- if(bytes_encoded < 0)
+ if(bytes_encoded <= 0)
return 0;
-
+
+ pts = codec->avctx->coded_frame->pts;
+ kf = codec->avctx->coded_frame->key_frame;
+
+#endif
+
if(bytes_encoded)
{
lqt_write_frame_header(file, track,
- -1, codec->avctx->coded_frame->pts,
- codec->avctx->coded_frame->key_frame);
-
+ -1, pts, kf);
+
result = !quicktime_write_data(file,
codec->buffer,
bytes_encoded);
@@ -1531,7 +1707,11 @@
return 0;
}
- lqt_ffmpeg_set_parameter(codec->avctx, key, value);
+ lqt_ffmpeg_set_parameter(codec->avctx,
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+ &codec->options,
+#endif
+ key, value);
@@ -1700,13 +1880,16 @@
char *compressor;
quicktime_stsd_t * stsd;
- avcodec_init();
+ // avcodec_init();
codec = calloc(1, sizeof(*codec));
if(!codec)
return;
+#if LIBAVCODEC_VERSION_INT < ((53<<16)|(8<<8)|0)
codec->avctx = avcodec_alloc_context();
-
+#else
+ codec->avctx = avcodec_alloc_context3(NULL);
+#endif
codec->encoder = encoder;
codec->decoder = decoder;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/mjpeg/libmjpeg.c
^
|
@@ -662,6 +662,12 @@
buffer,
buffer_size);
jpeg_read_header(&engine->jpeg_decompress, TRUE);
+#if 0
+ fprintf(stderr, "decompress_field %d: %d x %d\n",
+ field,
+ engine->jpeg_decompress.image_width,
+ engine->jpeg_decompress.image_height);
+#endif
guarantee_huff_tables(&engine->jpeg_decompress);
@@ -717,7 +723,15 @@
reset_buffer(&engine->output_buffer, &engine->output_size, &engine->output_allocated);
jpeg_buffer_dest(&engine->jpeg_compress, engine);
-
+ /* Fields can have different heights when the total height is odd */
+ engine->jpeg_compress.image_height = engine->field_heights[field];
+#if 0
+ fprintf(stderr, "compress_field %d: %d x %d\n",
+ field,
+ engine->jpeg_compress.image_width,
+ engine->jpeg_compress.image_height);
+#endif
+
engine->jpeg_compress.raw_data_in = TRUE;
jpeg_start_compress(&engine->jpeg_compress, TRUE);
@@ -779,12 +793,32 @@
{
mjpeg_compressor *result = lqt_bufalloc(sizeof(mjpeg_compressor));
+ /* Padded height */
result->field_h = mjpeg->coded_h / mjpeg->fields;
+
+ if(mjpeg->fields == 2)
+ {
+ /* Unpadded heights for the internal JPEG header */
+ result->field_heights[0] = mjpeg->output_h / 2;
+ result->field_heights[1] = mjpeg->output_h / 2;
+
+ /* Top field gets an extra scanline */
+ if(mjpeg->output_h % 2)
+ {
+ /* Top field comes as second field */
+ if(mjpeg->bottom_first)
+ result->field_heights[1]++;
+ else
+ result->field_heights[0]++;
+ }
+ }
+ else
+ result->field_heights[0] = mjpeg->output_h;
+
result->mjpeg = mjpeg;
result->jpeg_compress.err = jpeg_std_error(&result->jpeg_error.pub);
jpeg_create_compress(&result->jpeg_compress);
- result->jpeg_compress.image_width = mjpeg->coded_w;
- result->jpeg_compress.image_height = result->field_h;
+ result->jpeg_compress.image_width = mjpeg->output_w;
result->jpeg_compress.input_components = 3;
result->jpeg_compress.in_color_space = JCS_RGB;
jpeg_set_defaults(&result->jpeg_compress);
@@ -1174,33 +1208,6 @@
int data_offset;
} mjpeg_qt_hdr;
-#if 0
-
-#define LML_MARKER_SIZE 0x2c
-#define LML_MARKER_TAG 0xffe3
-static void insert_lml33_markers(unsigned char **buffer,
- long *field2_offset,
- long *buffer_size,
- long *buffer_allocated)
- {
- long marker_offset = -1;
-
- /* Search for existing marker to replace */
- // marker_offset = find_marker(*buffer, *buffer_size, LML_MARKER_TAG);
-
- /* Insert new marker */
- if(marker_offset < 0)
- {
- marker_offset = 2;
- insert_space(buffer,
- buffer_size,
- buffer_allocated,
- 2,
- LML_MARKER_SIZE);
- }
- }
-#endif
-
static void table_offsets(unsigned char *buffer,
long buffer_size,
mjpeg_qt_hdr *header)
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/plugins/mjpeg/libmjpeg.h
^
|
@@ -66,9 +66,12 @@
unsigned char **rows[3];
/* Temp rows for each MCU */
unsigned char **mcu_rows[3];
- /* Height of the field */
+ /* Height of the field (padded value) */
int field_h;
+ /* Output heights of the fields (can be different for both fields) */
+ int field_heights[MAXFIELDS];
+
} mjpeg_compressor;
typedef struct
|
|
Changed |
libquicktime-1.2.4.tar.gz/po/de.gmo
^
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/po/de.po
^
|
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: libquicktime 1.0.0pre1\n"
"Report-Msgid-Bugs-To: libquicktime-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-07-05 21:37+0200\n"
+"POT-Creation-Date: 2012-03-29 21:45+0200\n"
"PO-Revision-Date: 2007-04-15 22:08+0100\n"
"Last-Translator: Stefan Scheffler <stefanscheffler@gmx.net>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@@ -171,19 +171,19 @@
msgid "file->total_riffs >= MAX_RIFFS"
msgstr ""
-#: src/lqt_color.c:205
+#: src/lqt_color.c:216
#, c-format
msgid "Unknown colormodel (%d)\n"
msgstr "Unbekanntes Farbmodell (%d)\n"
-#: src/lqt_color.c:239
+#: src/lqt_color.c:250
msgid "Input colorspace is neither RGB nor YUV, can't predict conversion price"
msgstr ""
"Eingabe Farbmodell ist weder RGB noch YUV, kann Umwandlungskosten nicht "
"Vorrausberechnen."
# CHEC"
-#: src/lqt_color.c:246
+#: src/lqt_color.c:257
msgid ""
"Output colorspace is neither RGB nor YUV, can't predict conversion price"
msgstr ""
@@ -233,30 +233,41 @@
msgid "quicktime_set_audio_position: track >= file->total_atracks\n"
msgstr ""
-#: src/lqt_quicktime.c:1055
+#: src/lqt_quicktime.c:1022 src/lqt_quicktime.c:1032 src/lqt_quicktime.c:1048
+#: src/lqt_quicktime.c:1063 src/lqt_quicktime.c:1280 src/lqt_quicktime.c:1290
+#: src/lqt_quicktime.c:1306 src/lqt_quicktime.c:1321
+msgid "illegal track index"
+msgstr ""
+
+#: src/lqt_quicktime.c:1037 src/lqt_quicktime.c:1053 src/lqt_quicktime.c:1068
+#: src/lqt_quicktime.c:1295 src/lqt_quicktime.c:1311 src/lqt_quicktime.c:1326
+msgid "illegal edit list entry"
+msgstr ""
+
+#: src/lqt_quicktime.c:1111
#, c-format
msgid "lqt_set_cmodel: No track No. %d"
msgstr "lqt_set_cmodel: Kein Track Nr. %d"
-#: src/lqt_quicktime.c:1868
+#: src/lqt_quicktime.c:2000
msgid "read/write mode is not supported"
msgstr "Schreib/Lese Modus nicht unterstützt"
-#: src/lqt_quicktime.c:1896
+#: src/lqt_quicktime.c:2028
msgid "Opening failed (unsupported filetype)"
msgstr "Öffnen fehlgeschlagen (Dateityp nicht unterstützt)"
-#: src/lqt_quicktime.c:2076
+#: src/lqt_quicktime.c:2208
#, c-format
msgid "Setting parameter %s to %d"
msgstr "Setze Parameter %s zu %d"
-#: src/lqt_quicktime.c:2083
+#: src/lqt_quicktime.c:2215
#, c-format
msgid "Setting parameter %s to %f"
msgstr "Setze Parameter %s zu %f"
-#: src/lqt_quicktime.c:2091
+#: src/lqt_quicktime.c:2223
#, c-format
msgid "Setting parameter %s to %s"
msgstr "Setze Parameter %s zu %s"
@@ -1094,17 +1105,17 @@
msgid "Unsupported audio codec %s, try -la\n"
msgstr "Nicht unterstützter Audiocodec %s, versuch -la\n"
-#: utils/lqt_transcode.c:562
+#: utils/lqt_transcode.c:575
#, c-format
msgid "Unsupported format %s, try -lf"
msgstr "Nicht Unterstütztes Format %s, versuch -lf"
-#: utils/lqt_transcode.c:581
+#: utils/lqt_transcode.c:594
#, c-format
msgid "%6.2f%% Completed"
msgstr "%6.2f%% Fertig"
-#: utils/lqt_transcode.c:588
+#: utils/lqt_transcode.c:601
#, fuzzy, c-format
msgid "%6.2f%% Completed\n"
msgstr "%6.2f%% Fertig"
@@ -3510,26 +3521,47 @@
msgid "Arithmetic"
msgstr ""
-#: plugins/ffmpeg/audio.c:545 plugins/ffmpeg/audio.c:737
-msgid "avcodec_decode_audio error"
+#: plugins/ffmpeg/audio.c:550 plugins/ffmpeg/audio.c:767
+#, fuzzy
+msgid "avcodec_decode_audio4 error"
msgstr "avcodec_decode_audio Fehler"
-#: plugins/ffmpeg/audio.c:589
+#: plugins/ffmpeg/audio.c:569
+#, fuzzy
+msgid "avcodec_decode_audio3 error"
+msgstr "avcodec_decode_audio Fehler"
+
+#: plugins/ffmpeg/audio.c:584
+#, fuzzy
+msgid "avcodec_decode_audio2 error"
+msgstr "avcodec_decode_audio Fehler"
+
+#: plugins/ffmpeg/audio.c:634
msgid "Decode header failed"
msgstr "Dekodieren des Kopfes fehlgeschlagen"
-#: plugins/ffmpeg/audio.c:594
+#: plugins/ffmpeg/audio.c:639
msgid "Huh, frame not decoded?"
msgstr "Huh, Frame nicht dekodiert?"
+#: plugins/ffmpeg/audio.c:800
+msgid "avcodec_decode_audio error"
+msgstr "avcodec_decode_audio Fehler"
+
# :P
-#: plugins/ffmpeg/audio.c:789
+#: plugins/ffmpeg/audio.c:852
#, c-format
msgid "BUUUUG, buffer overflow, %d %d"
msgstr "BUUUUG, Pufferüberlauf, %d %d"
-#: plugins/ffmpeg/audio.c:963 plugins/ffmpeg/audio.c:1133
-msgid "Avcodec open failed"
+#: plugins/ffmpeg/audio.c:1027 plugins/ffmpeg/audio.c:1213
+#, fuzzy
+msgid "avcodec_open failed"
+msgstr "Öffnen von Avcodec fehlgeschlagen"
+
+#: plugins/ffmpeg/audio.c:1033 plugins/ffmpeg/audio.c:1219
+#, fuzzy
+msgid "avcodec_open2 failed"
msgstr "Öffnen von Avcodec fehlgeschlagen"
#: plugins/ffmpeg/lqt_ffmpeg.c:150
@@ -3715,24 +3747,24 @@
msgid "Codec index too large: %d"
msgstr "Videoindex zu groß: %d"
-#: plugins/ffmpeg/video.c:382
+#: plugins/ffmpeg/video.c:428
msgid "Unexpected pixel format for DNxHD."
msgstr ""
-#: plugins/ffmpeg/video.c:692
+#: plugins/ffmpeg/video.c:745
msgid "No avcC atom present, decoding is likely to fail"
msgstr ""
"Kein avcC Atom vorhanden, das decodieren wird wahrscheinlich fehlschlagen."
-#: plugins/ffmpeg/video.c:794 plugins/ffmpeg/video.c:805
+#: plugins/ffmpeg/video.c:886 plugins/ffmpeg/video.c:910
msgid "Skipping corrupted frame"
msgstr "Überspringe beschädigte Frames"
-#: plugins/ffmpeg/video.c:1118
+#: plugins/ffmpeg/video.c:1233
msgid "Unexpected stream data from DNxHD!"
msgstr ""
-#: plugins/ffmpeg/video.c:1243
+#: plugins/ffmpeg/video.c:1361
msgid "Enabling interlaced encoding"
msgstr "Aktiviere Interlaced Codierung"
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/po/libquicktime.pot
^
|
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: libquicktime 1.2.3\n"
+"Project-Id-Version: libquicktime 1.2.4\n"
"Report-Msgid-Bugs-To: libquicktime-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-07-05 21:37+0200\n"
+"POT-Creation-Date: 2012-03-29 21:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -161,16 +161,16 @@
msgid "file->total_riffs >= MAX_RIFFS"
msgstr ""
-#: src/lqt_color.c:205
+#: src/lqt_color.c:216
#, c-format
msgid "Unknown colormodel (%d)\n"
msgstr ""
-#: src/lqt_color.c:239
+#: src/lqt_color.c:250
msgid "Input colorspace is neither RGB nor YUV, can't predict conversion price"
msgstr ""
-#: src/lqt_color.c:246
+#: src/lqt_color.c:257
msgid ""
"Output colorspace is neither RGB nor YUV, can't predict conversion price"
msgstr ""
@@ -213,30 +213,41 @@
msgid "quicktime_set_audio_position: track >= file->total_atracks\n"
msgstr ""
-#: src/lqt_quicktime.c:1055
+#: src/lqt_quicktime.c:1022 src/lqt_quicktime.c:1032 src/lqt_quicktime.c:1048
+#: src/lqt_quicktime.c:1063 src/lqt_quicktime.c:1280 src/lqt_quicktime.c:1290
+#: src/lqt_quicktime.c:1306 src/lqt_quicktime.c:1321
+msgid "illegal track index"
+msgstr ""
+
+#: src/lqt_quicktime.c:1037 src/lqt_quicktime.c:1053 src/lqt_quicktime.c:1068
+#: src/lqt_quicktime.c:1295 src/lqt_quicktime.c:1311 src/lqt_quicktime.c:1326
+msgid "illegal edit list entry"
+msgstr ""
+
+#: src/lqt_quicktime.c:1111
#, c-format
msgid "lqt_set_cmodel: No track No. %d"
msgstr ""
-#: src/lqt_quicktime.c:1868
+#: src/lqt_quicktime.c:2000
msgid "read/write mode is not supported"
msgstr ""
-#: src/lqt_quicktime.c:1896
+#: src/lqt_quicktime.c:2028
msgid "Opening failed (unsupported filetype)"
msgstr ""
-#: src/lqt_quicktime.c:2076
+#: src/lqt_quicktime.c:2208
#, c-format
msgid "Setting parameter %s to %d"
msgstr ""
-#: src/lqt_quicktime.c:2083
+#: src/lqt_quicktime.c:2215
#, c-format
msgid "Setting parameter %s to %f"
msgstr ""
-#: src/lqt_quicktime.c:2091
+#: src/lqt_quicktime.c:2223
#, c-format
msgid "Setting parameter %s to %s"
msgstr ""
@@ -1034,17 +1045,17 @@
msgid "Unsupported audio codec %s, try -la\n"
msgstr ""
-#: utils/lqt_transcode.c:562
+#: utils/lqt_transcode.c:575
#, c-format
msgid "Unsupported format %s, try -lf"
msgstr ""
-#: utils/lqt_transcode.c:581
+#: utils/lqt_transcode.c:594
#, c-format
msgid "%6.2f%% Completed"
msgstr ""
-#: utils/lqt_transcode.c:588
+#: utils/lqt_transcode.c:601
#, c-format
msgid "%6.2f%% Completed\n"
msgstr ""
@@ -3181,25 +3192,41 @@
msgid "Arithmetic"
msgstr ""
-#: plugins/ffmpeg/audio.c:545 plugins/ffmpeg/audio.c:737
-msgid "avcodec_decode_audio error"
+#: plugins/ffmpeg/audio.c:550 plugins/ffmpeg/audio.c:767
+msgid "avcodec_decode_audio4 error"
+msgstr ""
+
+#: plugins/ffmpeg/audio.c:569
+msgid "avcodec_decode_audio3 error"
msgstr ""
-#: plugins/ffmpeg/audio.c:589
+#: plugins/ffmpeg/audio.c:584
+msgid "avcodec_decode_audio2 error"
+msgstr ""
+
+#: plugins/ffmpeg/audio.c:634
msgid "Decode header failed"
msgstr ""
-#: plugins/ffmpeg/audio.c:594
+#: plugins/ffmpeg/audio.c:639
msgid "Huh, frame not decoded?"
msgstr ""
-#: plugins/ffmpeg/audio.c:789
+#: plugins/ffmpeg/audio.c:800
+msgid "avcodec_decode_audio error"
+msgstr ""
+
+#: plugins/ffmpeg/audio.c:852
#, c-format
msgid "BUUUUG, buffer overflow, %d %d"
msgstr ""
-#: plugins/ffmpeg/audio.c:963 plugins/ffmpeg/audio.c:1133
-msgid "Avcodec open failed"
+#: plugins/ffmpeg/audio.c:1027 plugins/ffmpeg/audio.c:1213
+msgid "avcodec_open failed"
+msgstr ""
+
+#: plugins/ffmpeg/audio.c:1033 plugins/ffmpeg/audio.c:1219
+msgid "avcodec_open2 failed"
msgstr ""
#: plugins/ffmpeg/lqt_ffmpeg.c:150
@@ -3383,23 +3410,23 @@
msgid "Codec index too large: %d"
msgstr ""
-#: plugins/ffmpeg/video.c:382
+#: plugins/ffmpeg/video.c:428
msgid "Unexpected pixel format for DNxHD."
msgstr ""
-#: plugins/ffmpeg/video.c:692
+#: plugins/ffmpeg/video.c:745
msgid "No avcC atom present, decoding is likely to fail"
msgstr ""
-#: plugins/ffmpeg/video.c:794 plugins/ffmpeg/video.c:805
+#: plugins/ffmpeg/video.c:886 plugins/ffmpeg/video.c:910
msgid "Skipping corrupted frame"
msgstr ""
-#: plugins/ffmpeg/video.c:1118
+#: plugins/ffmpeg/video.c:1233
msgid "Unexpected stream data from DNxHD!"
msgstr ""
-#: plugins/ffmpeg/video.c:1243
+#: plugins/ffmpeg/video.c:1361
msgid "Enabling interlaced encoding"
msgstr ""
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/atom.c
^
|
@@ -26,20 +26,20 @@
#include <ctype.h>
static int read_type(uint8_t *data, uint8_t *type)
-{
- type[0] = data[4];
- type[1] = data[5];
- type[2] = data[6];
- type[3] = data[7];
+ {
+ type[0] = data[4];
+ type[1] = data[5];
+ type[2] = data[6];
+ type[3] = data[7];
-/* need this for quicktime_check_sig */
- if(isalpha(type[0]) && isalpha(type[1]) && isalpha(type[2]) && isalpha(type[3]))
- return 0;
- else if(type[0] | type[1] | type[2] | type[3] == 0)
- return 0; /* These kind of atoms do happen. */
- else
- return 1;
-}
+ /* need this for quicktime_check_sig */
+ if(isalpha(type[0]) && isalpha(type[1]) && isalpha(type[2]) && isalpha(type[3]))
+ return 0;
+ else if(type[0] | type[1] | type[2] | type[3] == 0)
+ return 0; /* These kind of atoms do happen. */
+ else
+ return 1;
+ }
static unsigned long read_size(uint8_t *data)
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/cmodel_default.c
^
|
@@ -257,6 +257,24 @@
j); \
TRANSFER_FRAME_TAIL \
break; \
+ case BC_YUV422P10: \
+ TRANSFER_YUV422P16_OUT_HEAD \
+ transfer_RGB888_to_YUV422P10((uint16_t *)output_y, \
+ (uint16_t *)output_u, \
+ (uint16_t *)output_v, \
+ (input), \
+ j); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_YUVJ422P10: \
+ TRANSFER_YUV422P16_OUT_HEAD \
+ transfer_RGB888_to_YUVJ422P10((uint16_t *)output_y, \
+ (uint16_t *)output_u, \
+ (uint16_t *)output_v, \
+ (input), \
+ j); \
+ TRANSFER_FRAME_TAIL \
+ break; \
case BC_YUV411P: \
TRANSFER_YUV411P_OUT_HEAD \
transfer_RGB888_to_YUV411P(output_y, \
@@ -502,7 +520,25 @@
(uint16_t*)(input), \
j); \
TRANSFER_FRAME_TAIL \
- break; \
+ break; \
+ case BC_YUV422P10: \
+ TRANSFER_YUV422P16_OUT_HEAD_16 \
+ transfer_RGB161616_to_YUV422P10(output_y, \
+ output_u, \
+ output_v, \
+ (uint16_t*)(input), \
+ j); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_YUVJ422P10: \
+ TRANSFER_YUV422P16_OUT_HEAD_16 \
+ transfer_RGB161616_to_YUVJ422P10(output_y, \
+ output_u, \
+ output_v, \
+ (uint16_t*)(input), \
+ j); \
+ TRANSFER_FRAME_TAIL \
+ break; \
case BC_YUV444P: \
TRANSFER_YUV444P_OUT_HEAD \
transfer_RGB161616_to_YUV444P(output_y, \
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/cmodel_yuv420p.c
^
|
@@ -636,6 +636,90 @@
break; \
} \
break; \
+ case BC_YUV422P10: \
+ switch(out_colormodel) \
+ { \
+ case BC_RGB888: \
+ TRANSFER_YUV422P16_IN_HEAD \
+ transfer_YUV422P10_to_RGB888((output), \
+ input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset)); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_RGB161616: \
+ TRANSFER_YUV422P16_IN_HEAD_16 \
+ transfer_YUV422P10_to_RGB161616((output), \
+ input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset)); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_YUV422P10: \
+ for(i = 0; i < out_h; i++) \
+ { \
+ uint16_t *output_y = (uint16_t *)(output_rows[0] + i * out_rowspan); \
+ uint16_t *output_u = (uint16_t *)(output_rows[1] + i * out_rowspan_uv); \
+ uint16_t *output_v = (uint16_t *)(output_rows[2] + i * out_rowspan_uv); \
+ uint16_t *input_y = (uint16_t *)(input_rows[0] + row_table[i] * in_rowspan); \
+ uint16_t *input_u = (uint16_t *)(input_rows[1] + row_table[i] * in_rowspan_uv); \
+ uint16_t *input_v = (uint16_t *)(input_rows[2] + row_table[i] * in_rowspan_uv); \
+ for(j = 0; j < out_w; j++) \
+ { \
+ transfer_YUV422P16_to_YUV420P16(input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset), \
+ output_y, \
+ output_u, \
+ output_v, \
+ j); \
+ } \
+ } \
+ break; \
+ } \
+ break; \
+ case BC_YUVJ422P10: \
+ switch(out_colormodel) \
+ { \
+ case BC_RGB888: \
+ TRANSFER_YUV422P16_IN_HEAD \
+ transfer_YUVJ422P10_to_RGB888((output), \
+ input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset)); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_RGB161616: \
+ TRANSFER_YUV422P16_IN_HEAD_16 \
+ transfer_YUVJ422P10_to_RGB161616((output), \
+ input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset)); \
+ TRANSFER_FRAME_TAIL \
+ break; \
+ case BC_YUVJ422P10: \
+ for(i = 0; i < out_h; i++) \
+ { \
+ uint16_t *output_y = (uint16_t *)(output_rows[0] + i * out_rowspan); \
+ uint16_t *output_u = (uint16_t *)(output_rows[1] + i * out_rowspan_uv); \
+ uint16_t *output_v = (uint16_t *)(output_rows[2] + i * out_rowspan_uv); \
+ uint16_t *input_y = (uint16_t *)(input_rows[0] + row_table[i] * in_rowspan); \
+ uint16_t *input_u = (uint16_t *)(input_rows[1] + row_table[i] * in_rowspan_uv); \
+ uint16_t *input_v = (uint16_t *)(input_rows[2] + row_table[i] * in_rowspan_uv); \
+ for(j = 0; j < out_w; j++) \
+ { \
+ transfer_YUV422P16_to_YUV420P16(input_y + (y_in_offset), \
+ input_u + (u_in_offset), \
+ input_v + (v_in_offset), \
+ output_y, \
+ output_u, \
+ output_v, \
+ j); \
+ } \
+ } \
+ break; \
+ } \
+ break; \
case BC_YUV444P16: \
switch(out_colormodel) \
{ \
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/colormodels.c
^
|
@@ -32,13 +32,15 @@
{
case BC_YUV420P: return 1; break;
case BC_YUV422P: return 1; break;
- case BC_YUV444P: return 1; break;
+ case BC_YUV444P: return 1; break;
case BC_YUV422P16: return 1; break;
- case BC_YUV444P16: return 1; break;
+ case BC_YUV444P16: return 1; break;
case BC_YUVJ420P: return 1; break;
case BC_YUVJ422P: return 1; break;
- case BC_YUVJ444P: return 1; break;
+ case BC_YUVJ444P: return 1; break;
case BC_YUV411P: return 1; break;
+ case BC_YUV422P10: return 1; break;
+ case BC_YUVJ422P10: return 1; break;
}
return 0;
}
@@ -61,14 +63,16 @@
// Planar
case BC_YUV420P: return 1; break;
case BC_YUV422P: return 1; break;
- case BC_YUV444P: return 1; break;
+ case BC_YUV444P: return 1; break;
case BC_YUVJ420P: return 1; break;
case BC_YUVJ422P: return 1; break;
- case BC_YUVJ444P: return 1; break;
+ case BC_YUVJ444P: return 1; break;
case BC_YUV422P16: return 2; break;
- case BC_YUV444P16: return 2; break;
- case BC_YUV422: return 2; break;
+ case BC_YUV444P16: return 2; break;
+ case BC_YUV422: return 2; break;
case BC_YUV411P: return 1; break;
+ case BC_YUV422P10: return 2; break;
+ case BC_YUVJ422P10: return 2; break;
}
return 0;
}
@@ -142,6 +146,8 @@
case BC_YUV422P16:
case BC_YUVJ420P:
case BC_YUVJ422P:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
cmodel_yuv420p(output_rows, \
input_rows, \
in_x, \
@@ -280,11 +286,14 @@
case BC_YUVJ422P:
case BC_YUV420P:
case BC_YUV422P:
- case BC_YUV444P:
- case BC_YUV411P:
+ case BC_YUV444P:
+ case BC_YUV411P:
+ case BC_YUV422P16:
+ case BC_YUV444P16:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
return 1;
break;
-
default:
return 0;
break;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/compression.c
^
|
@@ -337,6 +337,9 @@
int result;
quicktime_video_map_t *vtrack = &file->vtracks[track];
quicktime_trak_t * trak = vtrack->track;
+
+ // fprintf(stderr, "lqt_write_video_packet %ld %d\n",
+ // p->timestamp, p->duration);
lqt_start_encoding(file);
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/elst.c
^
|
@@ -24,24 +24,25 @@
#include "lqt_private.h"
#include <stdlib.h>
+#include <string.h>
void quicktime_elst_table_init(quicktime_elst_table_t *table)
-{
- table->duration = 0;
- table->time = 0;
- table->rate = 1;
-}
+ {
+ table->duration = 0;
+ table->time = 0;
+ table->rate = 1;
+ }
void quicktime_elst_table_delete(quicktime_elst_table_t *table)
-{
-}
+ {
+ }
void quicktime_read_elst_table(quicktime_t *file, quicktime_elst_table_t *table)
-{
- table->duration = quicktime_read_int32(file);
- table->time = quicktime_read_int32(file);
- table->rate = quicktime_read_fixed32(file);
-}
+ {
+ table->duration = quicktime_read_int32(file);
+ table->time = quicktime_read_int32(file);
+ table->rate = quicktime_read_fixed32(file);
+ }
void quicktime_write_elst_table(quicktime_t *file, quicktime_elst_table_t *table)
{
@@ -51,71 +52,109 @@
}
void quicktime_elst_table_dump(quicktime_elst_table_t *table)
-{
- lqt_dump(" edit list table\n");
- lqt_dump(" duration %ld\n", table->duration);
- lqt_dump(" time %ld\n", table->time);
- lqt_dump(" rate %f\n", table->rate);
-}
+ {
+ lqt_dump(" edit list table\n");
+ lqt_dump(" duration %d\n", table->duration);
+ lqt_dump(" time %d\n", table->time);
+ lqt_dump(" rate %f\n", table->rate);
+ }
void quicktime_elst_init(quicktime_elst_t *elst)
-{
- elst->version = 0;
- elst->flags = 0;
- elst->total_entries = 0;
- elst->table = 0;
-}
+ {
+ elst->version = 0;
+ elst->flags = 0;
+ elst->total_entries = 0;
+ elst->table = 0;
+ }
void quicktime_elst_init_all(quicktime_elst_t *elst)
-{
- if(!elst->total_entries)
- {
- elst->total_entries = 1;
- elst->table = (quicktime_elst_table_t*)malloc(sizeof(quicktime_elst_table_t) * elst->total_entries);
- quicktime_elst_table_init(&elst->table[0]);
- }
-}
+ {
+ if(!elst->total_entries)
+ {
+ elst->total_entries = 1;
+ elst->table = realloc(NULL, sizeof(*elst->table) * elst->total_entries);
+ quicktime_elst_table_init(&elst->table[0]);
+ }
+ }
+
+void quicktime_elst_fix_counts(quicktime_elst_t *elst,
+ int moov_scale, quicktime_trak_t * trak, int timescale)
+ {
+ int64_t offset_scaled;
+ offset_scaled = (int64_t)((double)trak->pts_offset / timescale * moov_scale + 0.5);
+ elst->table[0].duration = trak->tkhd.duration;
+
+ if(trak->pts_offset < 0)
+ {
+ elst->table[0].time = -trak->pts_offset;
+ }
+ else if(offset_scaled > 0)
+ {
+ /* Insert empty edit */
+ elst->total_entries++;
+ elst->table = realloc(elst->table, sizeof(*elst->table) * elst->total_entries);
+ memmove(elst->table + 1, elst->table, sizeof(*elst->table) * (elst->total_entries-1));
+ elst->table[0].time = -1;
+ elst->table[0].duration = offset_scaled;
+ elst->table[0].rate = 1.0;
+ }
+ }
+
+int64_t quicktime_elst_get_pts_offset(quicktime_elst_t *elst,
+ int moov_scale, int timescale)
+ {
+ if(elst->total_entries == 1)
+ {
+ if(elst->table[0].time > 0)
+ return - elst->table[0].time;
+ }
+ /* Detect empty edit */
+ else if((elst->total_entries == 2) &&
+ (elst->table[0].time == -1))
+ return (int64_t)((double)elst->table[0].duration / moov_scale * timescale + 0.5);
+ return 0;
+ }
void quicktime_elst_delete(quicktime_elst_t *elst)
-{
- int i;
- if(elst->total_entries)
- {
- for(i = 0; i < elst->total_entries; i++)
- quicktime_elst_table_delete(&elst->table[i]);
- free(elst->table);
- }
- elst->total_entries = 0;
-}
+ {
+ int i;
+ if(elst->total_entries)
+ {
+ for(i = 0; i < elst->total_entries; i++)
+ quicktime_elst_table_delete(&elst->table[i]);
+ free(elst->table);
+ }
+ elst->total_entries = 0;
+ }
void quicktime_elst_dump(quicktime_elst_t *elst)
-{
- int i;
- lqt_dump(" edit list (elst)\n");
- lqt_dump(" version %d\n", elst->version);
- lqt_dump(" flags %ld\n", elst->flags);
- lqt_dump(" total_entries %ld\n", elst->total_entries);
-
- for(i = 0; i < elst->total_entries; i++)
- {
- quicktime_elst_table_dump(&elst->table[i]);
- }
-}
+ {
+ int i;
+ lqt_dump(" edit list (elst)\n");
+ lqt_dump(" version %d\n", elst->version);
+ lqt_dump(" flags %ld\n", elst->flags);
+ lqt_dump(" total_entries %ld\n", elst->total_entries);
+
+ for(i = 0; i < elst->total_entries; i++)
+ {
+ quicktime_elst_table_dump(&elst->table[i]);
+ }
+ }
void quicktime_read_elst(quicktime_t *file, quicktime_elst_t *elst)
-{
- int i;
+ {
+ int i;
- elst->version = quicktime_read_char(file);
- elst->flags = quicktime_read_int24(file);
- elst->total_entries = quicktime_read_int32(file);
- elst->table = (quicktime_elst_table_t*)calloc(1, sizeof(quicktime_elst_table_t) * elst->total_entries);
- for(i = 0; i < elst->total_entries; i++)
- {
- quicktime_elst_table_init(&elst->table[i]);
- quicktime_read_elst_table(file, &elst->table[i]);
- }
-}
+ elst->version = quicktime_read_char(file);
+ elst->flags = quicktime_read_int24(file);
+ elst->total_entries = quicktime_read_int32(file);
+ elst->table = (quicktime_elst_table_t*)calloc(1, sizeof(quicktime_elst_table_t) * elst->total_entries);
+ for(i = 0; i < elst->total_entries; i++)
+ {
+ quicktime_elst_table_init(&elst->table[i]);
+ quicktime_read_elst_table(file, &elst->table[i]);
+ }
+ }
void quicktime_write_elst(quicktime_t *file, quicktime_elst_t *elst)
{
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/lqt_color.c
^
|
@@ -53,6 +53,8 @@
{ "YUV 4:4:4 planar", BC_YUV444P },
{ "YUV 4:2:2 planar (16 bit)", BC_YUV422P16 },
{ "YUV 4:4:4 planar (16 bit)", BC_YUV444P16 },
+ { "YUV 4:2:2 planar (10 bit)", BC_YUV422P10 },
+ { "YUV 4:2:2 planar (10 bit, jpeg)", BC_YUVJ422P10 },
{ "YUV 4:2:0 planar (jpeg)", BC_YUVJ420P },
{ "YUV 4:2:2 planar (jpeg)", BC_YUVJ422P },
{ "YUV 4:4:4 planar (jpeg)", BC_YUVJ444P },
@@ -77,6 +79,8 @@
case BC_YUVJ422P:
case BC_YUVJ444P:
case BC_YUV411P:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
return 1;
default:
return 0;
@@ -127,6 +131,8 @@
case BC_YUVJ444P:
case BC_YUVJ420P:
case BC_YUV411P:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
return 1;
default:
return 0;
@@ -149,6 +155,8 @@
case BC_YUV422P:
case BC_YUVJ422P:
case BC_YUV422P16:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
*sub_h = 2;
*sub_v = 1;
break;
@@ -198,6 +206,9 @@
case BC_YUV422P16:
case BC_YUV444P16:
return 48;
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
+ return 30;
case BC_RGBA16161616:
return 64;
default:
@@ -426,6 +437,8 @@
case BC_YUV422:
case BC_YUV422P16:
case BC_YUV444P16:
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
return 2;
break;
case BC_BGR888:
@@ -533,14 +546,19 @@
void lqt_rows_clear(uint8_t **rows,
int width, int height, int rowspan, int rowspan_uv, int colormodel)
{
- int i, j, bytes_per_element, bytes_per_line;
+ int i, j, bits_per_sample, bytes_per_element, bytes_per_line;
uint8_t * ptr;
uint16_t * ptr_16;
uint8_t * ptr_start;
int sub_h, sub_v;
+ uint16_t y_val, uv_val;
+ bits_per_sample = colormodel_get_bits(colormodel) / (lqt_colormodel_has_alpha(colormodel) ? 4 : 3);
bytes_per_element = get_bytes_per_element(colormodel);
bytes_per_line = bytes_per_element * width;
+ y_val = 1 << (bits_per_sample - 4); // This one is good for non-jpeg colormodels.
+ uv_val = 1 << (bits_per_sample - 1); // This one is good for both jpeg and non-jpeg colormodels.
+
switch(colormodel)
{
case BC_RGB565:
@@ -696,9 +714,11 @@
ptr += rowspan_uv;
}
break;
+ case BC_YUVJ422P10:
+ y_val = 0; // For jpeg colormodels.
case BC_YUV422P16:
case BC_YUV444P16:
-
+ case BC_YUV422P10:
lqt_colormodel_get_chroma_sub(colormodel, &sub_h, &sub_v);
/* Y */
@@ -708,7 +728,7 @@
ptr_16 = (uint16_t*)ptr_start;
for(j = 0; j < width; j++)
{
- *ptr_16 = 0x1000;
+ *ptr_16 = y_val;
ptr_16++;
}
ptr_start += rowspan;
@@ -724,7 +744,7 @@
ptr_16 = (uint16_t*)ptr_start;
for(j = 0; j < width; j++)
{
- *ptr_16 = 0x1000;
+ *ptr_16 = uv_val;
ptr_16++;
}
ptr_start += rowspan;
@@ -737,13 +757,13 @@
ptr_16 = (uint16_t*)ptr_start;
for(j = 0; j < width; j++)
{
- *ptr_16 = 0x1000;
+ *ptr_16 = uv_val;
ptr_16++;
}
ptr_start += rowspan;
}
-
+
break;
}
}
@@ -974,6 +994,8 @@
case BC_YUVJ444P: return 1; break;
case BC_YUV422P16: return 1; break;
case BC_YUV444P16: return 1; break;
+ case BC_YUV422P10: return 1; break;
+ case BC_YUVJ422P10: return 1; break;
}
break;
case BC_RGBA8888:
@@ -1020,6 +1042,8 @@
case BC_YUVJ444P: return 0; break;
case BC_YUV422P16: return 1; break;
case BC_YUV444P16: return 1; break;
+ case BC_YUV422P10: return 1; break;
+ case BC_YUVJ422P10: return 1; break;
}
break;
case BC_RGBA16161616:
@@ -1298,6 +1322,14 @@
case BC_YUV422P16: return 0; break;
}
break;
+ case BC_YUV422P10:
+ case BC_YUVJ422P10:
+ switch(out_cmodel)
+ {
+ case BC_RGB888: return 1; break;
+ case BC_RGB161616: return 1; break;
+ }
+ break;
}
return 0;
}
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/lqt_quicktime.c
^
|
@@ -1016,6 +1016,62 @@
return 0;
}
+long lqt_video_edit_list_total_entries(quicktime_t * file, int track)
+{
+ if(track < 0 || track >= quicktime_video_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ return file->vtracks[track].track->edts.elst.total_entries;
+}
+
+long lqt_video_edit_duration(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_video_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ if(entry_index < 0 || entry_index >= file->vtracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0;
+ }
+
+ // convert to media timescale
+ return (long)((double)file->vtracks[track].track->edts.elst.table[entry_index].duration / file->moov.mvhd.time_scale * file->vtracks[track].track->mdia.mdhd.time_scale + 0.5);
+}
+
+long lqt_video_edit_time(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_video_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ if(entry_index < 0 || entry_index >= file->vtracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0;
+ }
+
+ return file->vtracks[track].track->edts.elst.table[entry_index].time;
+}
+
+float lqt_video_edit_rate(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_video_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0.0f;
+ }
+
+ if(entry_index < 0 || entry_index >= file->vtracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0.0f;
+ }
+
+ return file->vtracks[track].track->edts.elst.table[entry_index].rate;
+}
+
void quicktime_set_cmodel(quicktime_t *file, int colormodel)
{
int i;
@@ -1116,6 +1172,15 @@
return 0;
}
+int64_t lqt_get_frame_time(quicktime_t * file, int track, int frame)
+ {
+ int64_t dummy1;
+ int64_t dummy2;
+ return
+ quicktime_sample_to_time(&file->vtracks[track].track->mdia.minf.stbl.stts, frame,
+ &dummy1, &dummy2);
+ }
+
/*
* Return the timestamp of the NEXT frame to be decoded.
* Call this BEFORE one of the decoding functions.
@@ -1209,6 +1274,62 @@
return result;
}
+long lqt_audio_edit_list_total_entries(quicktime_t * file, int track)
+{
+ if(track < 0 || track >= quicktime_audio_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ return file->atracks[track].track->edts.elst.total_entries;
+}
+
+long lqt_audio_edit_duration(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_audio_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ if(entry_index < 0 || entry_index >= file->atracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0;
+ }
+
+ // convert to media timescale
+ return (long)((double)file->atracks[track].track->edts.elst.table[entry_index].duration / file->moov.mvhd.time_scale * file->atracks[track].track->mdia.mdhd.time_scale + 0.5);
+}
+
+long lqt_audio_edit_time(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_audio_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0;
+ }
+
+ if(entry_index < 0 || entry_index >= file->atracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0;
+ }
+
+ return file->atracks[track].track->edts.elst.table[entry_index].time;
+}
+
+float lqt_audio_edit_rate(quicktime_t * file, int track, int entry_index)
+{
+ if(track < 0 || track >= quicktime_audio_tracks(file)) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal track index");
+ return 0.0f;
+ }
+
+ if(entry_index < 0 || entry_index >= file->atracks[track].track->edts.elst.total_entries) {
+ lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "illegal edit list entry");
+ return 0.0f;
+ }
+
+ return file->atracks[track].track->edts.elst.table[entry_index].rate;
+}
+
int quicktime_write_frame(quicktime_t *file,
unsigned char *video_buffer,
int64_t bytes, int track)
@@ -1456,9 +1577,20 @@
// Initialize maps, for reading only
+
+
void quicktime_init_maps(quicktime_t * file)
{
int i, j, k, dom, track;
+
+ /* Initialize trak for reading */
+
+ for(i = 0; i < file->moov.total_tracks; i++)
+ {
+ quicktime_trak_fix_counts(file, file->moov.trak[i],
+ file->moov.mvhd.time_scale);
+ }
+
/* get tables for all the different tracks */
file->total_atracks = quicktime_audio_tracks(file);
@@ -2791,3 +2923,112 @@
{
file->max_riff_size = size * 1024 * 1024;
}
+
+/* PTS offsets */
+
+/** \ingroup audio_encode
+ * \brief Set an audio pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS of the first audio sample (in samples)
+ */
+
+void lqt_set_audio_pts_offset(quicktime_t * file, int track, int64_t offset)
+ {
+ quicktime_trak_t * trak;
+
+ if((track < 0) && (track >= file->total_atracks))
+ return;
+
+ trak = file->atracks[track].track;
+ trak->pts_offset = offset;
+ }
+
+/** \ingroup audio_decode
+ * \brief Get an audio pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS of the first audio sample (in samples)
+ */
+
+int64_t lqt_get_audio_pts_offset(quicktime_t * file, int track)
+ {
+ quicktime_trak_t * trak;
+ if((track < 0) && (track >= file->total_atracks))
+ return 0;
+
+ trak = file->atracks[track].track;
+ return trak->pts_offset;
+ }
+
+
+/** \ingroup video_encode
+ * \brief Set an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS of the first video frame (in timescale units)
+ */
+
+void lqt_set_video_pts_offset(quicktime_t * file, int track, int64_t offset)
+ {
+ quicktime_trak_t * trak;
+ if((track < 0) && (track >= file->total_vtracks))
+ return;
+ trak = file->vtracks[track].track;
+ trak->pts_offset = offset;
+ }
+
+
+/** \ingroup video_decode
+ * \brief Get an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS of the first video frame (in timescale units)
+ */
+
+int64_t lqt_get_video_pts_offset(quicktime_t * file, int track)
+ {
+ quicktime_trak_t * trak;
+ if((track < 0) && (track >= file->total_vtracks))
+ return 0;
+ trak = file->vtracks[track].track;
+ return trak->pts_offset;
+
+ }
+
+
+/** \ingroup text_encode
+ * \brief Set an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \param offset PTS offset of the subtitles (in timescale units)
+ */
+
+void lqt_set_text_pts_offset(quicktime_t * file, int track, int64_t offset)
+ {
+ quicktime_trak_t * trak;
+ if((track < 0) && (track >= file->total_ttracks))
+ return;
+ trak = file->ttracks[track].track;
+ trak->pts_offset = offset;
+
+ }
+
+
+/** \ingroup text_decode
+ * \brief Get an video pts offset
+ * \param file A quicktime handle
+ * \param track Track index (starting with 0)
+ * \returns PTS offset of the subtitles (in timescale units)
+ */
+
+int64_t lqt_get_text_pts_offset(quicktime_t * file, int track)
+ {
+ quicktime_trak_t * trak;
+ if((track < 0) && (track >= file->total_ttracks))
+ return 0;
+ trak = file->ttracks[track].track;
+ return trak->pts_offset;
+
+ }
+
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/mvhd.c
^
|
@@ -112,9 +112,10 @@
}
void quicktime_mhvd_init_video(quicktime_t *file, quicktime_mvhd_t *mvhd, int timescale)
-{
- mvhd->time_scale = timescale;
-}
+ {
+ if((mvhd->time_scale % timescale) || (mvhd->time_scale < timescale))
+ mvhd->time_scale = timescale;
+ }
void quicktime_write_mvhd(quicktime_t *file, quicktime_mvhd_t *mvhd)
{
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/src/trak.c
^
|
@@ -178,8 +178,9 @@
{
lqt_dump(" track (trak)\n");
quicktime_tkhd_dump(&trak->tkhd);
- if(trak->has_edts) quicktime_edts_dump(&trak->edts);
- if (trak->has_tref)
+ if(trak->has_edts)
+ quicktime_edts_dump(&trak->edts);
+ if(trak->has_tref)
quicktime_tref_dump(&trak->tref);
quicktime_mdia_dump(&trak->mdia);
@@ -281,18 +282,18 @@
{
quicktime_atom_t atom;
quicktime_atom_write_header(file, &atom, "trak");
-
+
quicktime_write_tkhd(file, &trak->tkhd);
-
+
if(trak->has_edts)
quicktime_write_edts(file, &trak->edts);
quicktime_write_mdia(file, &trak->mdia);
-
+
if (trak->has_tref)
quicktime_write_tref(file, &trak->tref);
-
+
quicktime_atom_write_footer(file, &atom);
-
+
return 0;
}
@@ -600,15 +601,31 @@
return 0;
}
+static int fix_counts_read(quicktime_trak_t *trak,
+ int timescale, int moov_time_scale)
+ {
+ if(trak->has_edts)
+ {
+ trak->pts_offset = quicktime_elst_get_pts_offset(&trak->edts.elst,
+ moov_time_scale, timescale);
+ }
+ return 0;
+ }
+
int quicktime_trak_fix_counts(quicktime_t *file, quicktime_trak_t *trak,
int moov_time_scale)
{
int64_t duration;
int timescale;
quicktime_stts_t * stts;
- long samples = quicktime_track_samples(file, trak);
-
+ long samples;
+
quicktime_trak_duration(trak, &duration, ×cale);
+
+ if(file->rd)
+ return fix_counts_read(trak, timescale, moov_time_scale);
+
+ samples = quicktime_track_samples(file, trak);
/* get duration in movie's units */
trak->tkhd.duration = (long)((double)duration / timescale * moov_time_scale + 0.5);
@@ -616,8 +633,11 @@
trak->mdia.mdhd.time_scale = timescale;
if(trak->has_edts)
- trak->edts.elst.table[0].duration = trak->tkhd.duration;
-
+ {
+ quicktime_elst_fix_counts(&trak->edts.elst,
+ moov_time_scale, trak, timescale);
+ }
+
if(trak->mdia.minf.is_panorama)
trak->edts.elst.total_entries = 1;
@@ -655,6 +675,9 @@
return 0;
}
+int64_t quicktime_elst_get_pts_offset(quicktime_elst_t *elst,
+ int moov_scale, int timescale);
+
long quicktime_chunk_samples(quicktime_trak_t *trak, long chunk)
{
long result, current_chunk;
|
[-]
[+]
|
Changed |
libquicktime-1.2.4.tar.gz/utils/lqt_transcode.c
^
|
@@ -470,6 +470,19 @@
{
quicktime_close(h->in_file);
quicktime_close(h->out_file);
+ if(h->video_buffer)
+ lqt_rows_free(h->video_buffer);
+
+ if(h->audio_buffer_i)
+ {
+ free(h->audio_buffer_i[0]);
+ free(h->audio_buffer_i);
+ }
+ if(h->audio_buffer_f)
+ {
+ free(h->audio_buffer_f[0]);
+ free(h->audio_buffer_f);
+ }
}
|