summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-04-06 21:08:29 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-04-06 21:08:29 +0000
commit24f44f3b064fc1931183a1ae06ec2f3bd8a69036 (patch)
treea7e1490812292919a470400f3a0ed25e6866801c /src
parent55e772ec62ef638f8a0b44e379da663f78245355 (diff)
downloadxine-lib-24f44f3b064fc1931183a1ae06ec2f3bd8a69036.tar.gz
xine-lib-24f44f3b064fc1931183a1ae06ec2f3bd8a69036.tar.bz2
divx5 codec support, patch contributed by heiko schaefer
CVS patchset: 1691 CVS date: 2002/04/06 21:08:29
Diffstat (limited to 'src')
-rw-r--r--src/libdivx4/decore-if.h25
-rw-r--r--src/libdivx4/xine_decoder.c19
2 files changed, 39 insertions, 5 deletions
diff --git a/src/libdivx4/decore-if.h b/src/libdivx4/decore-if.h
index 869057dad..8354abf9c 100644
--- a/src/libdivx4/decore-if.h
+++ b/src/libdivx4/decore-if.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2001 the xine project
+ * Copyright (C) 2001-2002 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free video player.
*
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: decore-if.h,v 1.2 2001/10/27 04:30:39 hrm Exp $
+ * $Id: decore-if.h,v 1.3 2002/04/06 21:08:29 guenter Exp $
*
* This file documents the interface for the decore() function
* in libdivxdecore. In case of problems, it is recommended you compare
@@ -57,6 +57,12 @@ extern "C" {
#define DEC_OPT_FRAME_311 6
#define DEC_OPT_SETPP2 7
#define DEC_OPT_VERSION 8
+#define DEC_OPT_SETPP_ADV 10 /* advanced (personalized) postprocessing settings */
+#define DEC_OPT_SETDEBUG 11
+#define DEC_OPT_INIT_VOL 12
+#define DEC_OPT_CONVERTYUV 13
+#define DEC_OPT_CONVERTYV12 14
+#define DEC_OPT_GETVOLINFO 15
/* decore() return values. */
#define DEC_OK 0
@@ -70,6 +76,7 @@ extern "C" {
#define DEC_UYVY 2
#define DEC_420 3
#define DEC_YV12 13 /* looks like an afterthought, eh? */
+#define DEC_ARGB 14
/* colour formats -- rgb
not yet used by xine, but perhaps in the future.
@@ -123,6 +130,8 @@ typedef struct
int y_dim; /* frame height */
int output_format; /* refers to colour formats defined above */
int time_incr; /* mystery parameter, use 15 */
+ int codec_version;
+ int build_number;
DEC_BUFFERS buffers; /* memcpy 0's in this struct before init */
} DEC_PARAM;
@@ -148,6 +157,16 @@ typedef struct
typedef struct
{
int postproc_level; /* between 0-100, actually used 0-60 */
+
+ int deblock_hor_luma;
+ int deblock_ver_luma;
+ int deblock_hor_chr;
+ int deblock_ver_chr;
+ int dering_luma;
+ int dering_chr;
+
+ int pp_semaphore;
+
} DEC_SET;
/* structure for DEC_USER output format, should be used instead of bmp ptr */
diff --git a/src/libdivx4/xine_decoder.c b/src/libdivx4/xine_decoder.c
index 45acd356a..84b835f20 100644
--- a/src/libdivx4/xine_decoder.c
+++ b/src/libdivx4/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.23 2002/04/01 17:59:40 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.24 2002/04/06 21:08:29 guenter Exp $
*
* xine decoder plugin using divx4
*
@@ -209,6 +209,13 @@ static void divx4_set_pp(divx4_decoder_t *this) {
"divx4: Valid range 0-6, reduce if you get frame drop\n",
this->postproc);
setpp.postproc_level=this->postproc*10;
+ setpp.deblock_hor_luma = 0;
+ setpp.deblock_ver_luma = 0;
+ setpp.deblock_hor_chr = 0;
+ setpp.deblock_ver_chr = 0;
+ setpp.dering_luma = 0;
+ setpp.dering_chr = 0;
+ setpp.pp_semaphore = 0;
ret = this->decore((unsigned long)this, DEC_OPT_SETPP, &setpp, 0);
if (ret != DEC_OK)
@@ -236,10 +243,17 @@ static int divx4_init_decoder(divx4_decoder_t *this, buf_element_t *buf)
switch (buf->type & 0xFFFF0000) {
case BUF_VIDEO_MSMPEG4_V12:
case BUF_VIDEO_MSMPEG4_V3:
- this->use_311_compat = 1;
+ if (this->version >= 20020303) {
+ param.codec_version=311;
+ this->use_311_compat = 0;
+ } else {
+ this->use_311_compat = 1;
+ }
break;
case BUF_VIDEO_MPEG4:
this->use_311_compat = 0;
+ if (this->version >= 20020303)
+ param.codec_version=500;
break;
default:
printf ("divx4: unknown video format (buftype: 0x%08X)\n",
@@ -251,6 +265,7 @@ static int divx4_init_decoder(divx4_decoder_t *this, buf_element_t *buf)
param.y_dim=this->biHeight;
param.time_incr = 15; /* no idea what this does */
param.output_format=DEC_USER;
+ param.build_number=0;
memset(&param.buffers, 0, sizeof(param.buffers));
ret = this->decore((unsigned long)this, DEC_OPT_INIT, &param, &this->bih);