changeset 4227:4b652eac6738

added skeleton for QT SMC decoder
author melanson
date Fri, 18 Jan 2002 05:43:48 +0000
parents 63baf6de03e1
children bcbe3359e88f
files Makefile codec-cfg.c codec-cfg.h dec_video.c etc/codecs.conf qtsmc.c
diffstat 6 files changed, 50 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jan 18 02:51:24 2002 +0000
+++ b/Makefile	Fri Jan 18 05:43:48 2002 +0000
@@ -27,7 +27,7 @@
 # a BSD compatible 'install' program
 INSTALL = install
 
-SRCS_COMMON = cyuv.c adpcm.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c cinepak.c fli.c qtrle.c codec-cfg.c cfgparser.c my_profile.c RTjpegN.c minilzo.c nuppelvideo.c spudec.c playtree.c playtreeparser.c asxparser.c
+SRCS_COMMON = cyuv.c adpcm.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c cinepak.c fli.c qtrle.c codec-cfg.c cfgparser.c my_profile.c RTjpegN.c minilzo.c nuppelvideo.c spudec.c playtree.c playtreeparser.c asxparser.c qtsmc.c
 SRCS_MENCODER = mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/img_format.c libvo/osd.c
 SRCS_MPLAYER = mplayer.c $(SRCS_COMMON) find_sub.c subreader.c lirc_mp.c mixer.c vobsub.c
 
--- a/codec-cfg.c	Fri Jan 18 02:51:24 2002 +0000
+++ b/codec-cfg.c	Fri Jan 18 05:43:48 2002 +0000
@@ -241,6 +241,7 @@
 		"qtrle",
 		"nuv",
 		"cyuv",
+		"qtsmc",
 		NULL
 	};
         char **drv=audioflag?audiodrv:videodrv;
--- a/codec-cfg.h	Fri Jan 18 02:51:24 2002 +0000
+++ b/codec-cfg.h	Fri Jan 18 05:43:48 2002 +0000
@@ -53,6 +53,7 @@
 #define VFM_QTRLE 14
 #define VFM_NUV 15
 #define VFM_CYUV 16
+#define VFM_QTSMC 17
 
 #ifndef GUID_TYPE
 #define GUID_TYPE
--- a/dec_video.c	Fri Jan 18 02:51:24 2002 +0000
+++ b/dec_video.c	Fri Jan 18 05:43:48 2002 +0000
@@ -157,6 +157,15 @@
   int height,
   int bit_per_pixel);
 
+void qt_decode_smc(
+  unsigned char *encoded,
+  int encoded_size,
+  unsigned char *decoded,
+  int width,
+  int height,
+  int encoded_bpp,
+  int bytes_per_pixel);
+
 //**************************************************************************//
 //             The OpenDivX stuff:
 //**************************************************************************//
@@ -593,6 +602,7 @@
  case VFM_MSVIDC:
  case VFM_FLI:
  case VFM_QTRLE:
+ case VFM_QTSMC:
    {
 #ifdef USE_MP_IMAGE
     sh_video->image->type=MP_IMGTYPE_STATIC;
@@ -945,6 +955,14 @@
         ((out_fmt&255)+7)/8);
     blit_frame = 3;
     break;
+  case VFM_QTSMC:
+    qt_decode_smc(
+        start, in_size, sh_video->our_out_buffer,
+        sh_video->disp_w, sh_video->disp_h,
+        sh_video->bih->biBitCount,
+        ((out_fmt&255)+7)/8);
+    blit_frame = 3;
+    break;
  case VFM_CYUV:
    decode_cyuv(start, in_size, sh_video->our_out_buffer,
       sh_video->disp_w, sh_video->disp_h, (out_fmt==IMGFMT_YUY2)?16:(out_fmt&255));
--- a/etc/codecs.conf	Fri Jan 18 02:51:24 2002 +0000
+++ b/etc/codecs.conf	Fri Jan 18 05:43:48 2002 +0000
@@ -328,6 +328,14 @@
   driver cyuv
   out UYVY
 
+videocodec qtsmc
+  info "Apple Graphics (SMC) codec"
+  status buggy
+; codec fourcc = "smc "
+  format 0x20636d73
+  driver qtsmc
+  out BGR32,BGR24
+
 audiocodec imaadpcm
   info "IMA ADPCM"
   status working
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtsmc.c	Fri Jan 18 05:43:48 2002 +0000
@@ -0,0 +1,21 @@
+/*
+    Apple Graphics (SMC) Decoder for MPlayer
+    by Mike Melanson
+*/
+
+#include "config.h"
+#include "bswap.h"
+
+#define BE_16(x) (be2me_16(*(unsigned short *)(x)))
+#define BE_32(x) (be2me_32(*(unsigned int *)(x)))
+
+void qt_decode_smc(
+  unsigned char *encoded,
+  int encoded_size,
+  unsigned char *decoded,
+  int width,
+  int height,
+  int bytes_per_pixel)
+{
+
+}