changeset 6506:f0788e0f7475

SVQ1 added
author arpi
date Sat, 22 Jun 2002 23:09:40 +0000
parents e3a166f8e81f
children 1704aa0247e8
files codec-cfg.c codec-cfg.h libmpcodecs/Makefile libmpcodecs/vd.c libmpcodecs/vd_svq1.c
diffstat 5 files changed, 73 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Sat Jun 22 23:07:41 2002 +0000
+++ b/codec-cfg.c	Sat Jun 22 23:09:40 2002 +0000
@@ -261,6 +261,7 @@
 		"zlib",
 		"mpegpes",
 		"realvid",
+		"svq1",
 		NULL
 	};
         char **drv=audioflag?audiodrv:videodrv;
--- a/codec-cfg.h	Sat Jun 22 23:07:41 2002 +0000
+++ b/codec-cfg.h	Sat Jun 22 23:09:40 2002 +0000
@@ -74,6 +74,7 @@
 #define VFM_ZLIB 24
 #define VFM_MPEGPES 25
 #define VFM_REAL 26
+#define VFM_SVQ1 27
 
 #ifndef GUID_TYPE
 #define GUID_TYPE
--- a/libmpcodecs/Makefile	Sat Jun 22 23:07:41 2002 +0000
+++ b/libmpcodecs/Makefile	Sat Jun 22 23:09:40 2002 +0000
@@ -5,10 +5,10 @@
 LIBNAME2 = libmpencoders.a
 
 AUDIO_SRCS=dec_audio.c ad.c ad_a52.c ad_acm.c ad_alaw.c ad_dk3adpcm.c ad_dk4adpcm.c ad_dshow.c ad_dvdpcm.c ad_ffmpeg.c ad_hwac3.c ad_imaadpcm.c ad_mp3.c ad_msadpcm.c ad_pcm.c ad_roqaudio.c ad_msgsm.c ad_faad.c ad_vorbis.c ad_libmad.c ad_real.c
-VIDEO_SRCS=dec_video.c vd.c vd_null.c vd_real.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_nuv.c vd_libmpeg2.c vd_msrle.c vd_huffyuv.c vd_zlib.c vd_mpegpes.c
+VIDEO_SRCS=dec_video.c vd.c vd_null.c vd_real.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_nuv.c vd_libmpeg2.c vd_msrle.c vd_huffyuv.c vd_zlib.c vd_mpegpes.c vd_svq1.c
 VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c
 ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c
-NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/cyuv.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c
+NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/cyuv.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c native/svq1.c
 
 ifeq ($(FAME),yes)
 VFILTER_SRCS += vf_fame.c
--- a/libmpcodecs/vd.c	Sat Jun 22 23:07:41 2002 +0000
+++ b/libmpcodecs/vd.c	Sat Jun 22 23:09:40 2002 +0000
@@ -51,6 +51,7 @@
 extern vd_functions_t mpcodecs_vd_zlib;
 extern vd_functions_t mpcodecs_vd_mpegpes;
 extern vd_functions_t mpcodecs_vd_real;
+extern vd_functions_t mpcodecs_vd_svq1;
 
 vd_functions_t* mpcodecs_vd_drivers[] = {
         &mpcodecs_vd_null,
@@ -99,6 +100,7 @@
 #ifdef USE_REALCODECS
 	&mpcodecs_vd_real,
 #endif
+	&mpcodecs_vd_svq1,
 	NULL
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libmpcodecs/vd_svq1.c	Sat Jun 22 23:09:40 2002 +0000
@@ -0,0 +1,67 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "config.h"
+#include "mp_msg.h"
+
+#include "vd_internal.h"
+
+static vd_info_t info = {
+	"SVQ1 (Sorenson v1) Video decoder",
+	"svq1",
+	VFM_SVQ1,
+	"A'rpi",
+	"XINE team",
+	"native codec"
+};
+
+LIBVD_EXTERN(svq1)
+
+#include "native/svq1.h"
+
+// to set/get/query special features/parameters
+static int control(sh_video_t *sh,int cmd,void* arg,...){
+    return CONTROL_UNKNOWN;
+}
+
+// init driver
+static int init(sh_video_t *sh){
+    if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YVU9)) return 0;
+
+    sh->context=malloc(sizeof(svq1_t));
+    memset(sh->context,0,sizeof(svq1_t));
+    
+    return 1;
+}
+
+// uninit driver
+static void uninit(sh_video_t *sh){
+    svq1_free(sh->context);
+    sh->context=NULL;
+}
+
+// decode a frame
+static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
+    mp_image_t* mpi;
+    svq1_t* svq1=sh->context;
+    int ret;
+    
+    if(len<=0) return NULL; // skipped frame
+    
+    ret=svq1_decode_frame(svq1,data);
+    
+    mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE, 
+	sh->disp_w, sh->disp_h);
+    if(!mpi) return NULL;
+    
+    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"SVQ1: ret=%d wh=%dx%d p=%p   \n",ret,svq1->width,svq1->height,svq1->current);
+    
+    mpi->planes[0]=svq1->base[0];
+    mpi->planes[1]=svq1->base[1];
+    mpi->planes[2]=svq1->base[2];
+    mpi->stride[0]=svq1->luma_width;
+    mpi->stride[1]=mpi->stride[2]=svq1->chroma_width;
+    
+    return mpi;
+}
+