[MPlayer-dev-eng] [PATCH] RFC: CrystalHD decoder support

Diego Biurrun diego at biurrun.de
Wed Dec 22 13:31:40 CET 2010


On Sun, Dec 19, 2010 at 06:50:04PM -0700, Philip Langdale wrote:
>
> --- a/Makefile
> +++ b/Makefile
> @@ -330,6 +330,8 @@ SRCS_COMMON-$(XMMS_PLUGINS)          += libmpdemux/demux_xmms.c
>  SRCS_COMMON-$(XVID4)                 += libmpcodecs/vd_xvid4.c
>  SRCS_COMMON-$(ZR)                    += libmpcodecs/vd_zrmjpeg.c \
>                                          libmpcodecs/vf_zrmjpeg.c
> +SRCS_COMMON-$(CRYSTALHD)             += libmpcodecs/vd_crystalhd.c
> +

alphabetical order please

> --- a/configure
> +++ b/configure
> @@ -8212,6 +8231,7 @@ XVMC = $_xvmc
>  XVR100 = $_xvr100
>  YUV4MPEG = $_yuv4mpeg
>  ZR = $_zr
> +CRYSTALHD = $_crystalhd

same here

> @@ -8498,6 +8518,7 @@ $def_vorbis
>  $def_x264
>  $def_xvid
>  $def_zlib
> +$def_crystalhd

and here

> --- /dev/null
> +++ b/libmpcodecs/vd_crystalhd.c
> @@ -0,0 +1,609 @@
> +/*
> + * - CrystalHD decoder module for mplayer/mencoder -

It's pointless to note this is for MPlayer/MEncoder.

> + * Copyright(C) 2010 Philip Langdale <mplayer.philipl at overt.org>
> + *
> + * This file is part of MPlayer.
> + *
> + * MPlayer is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * MPlayer is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with MPlayer; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + *
> + * Credits:
> + * fast_memcpy: From libcrystalhd
> + * extract_sps_pps_from_avcc: from xbmc

Please place the credits above the license boilerplate.

> +typedef struct {
> +} Priv;

Gah, typedefs and uppercased names...

> +static mp_image_t mpi_no_picture =
> +{
> +	.type = MP_IMGTYPE_INCOMPLETE
> +};

Please use K&R style, 4 space indentation, no tabs.

> +static int extract_sps_pps_from_avcc(Priv *priv, uint8_t *extradata, uint32_t extradata_size)

Please keep lines below 80 characters where easily possible.

> +static uint8_t name2subtype(Priv *priv, const char *name)
> +{
> +   if (strcmp(name, "chddivx") == 0) {
> +      return BC_MSUBTYPE_DIVX;
> +   } else if (strcmp(name, "chddivx3") == 0) {
> +      return BC_MSUBTYPE_DIVX311;
> +   } else if (strcmp(name, "chdmpeg1") == 0) {
> +      return BC_MSUBTYPE_MPEG1VIDEO;
> +   } else if (strcmp(name, "chdmpeg2") == 0) {
> +      return BC_MSUBTYPE_MPEG2VIDEO;
> +   } else if (strcmp(name, "chdvc1") == 0) {
> +      return BC_MSUBTYPE_VC1;
> +   } else if (strcmp(name, "chdwvc1") == 0) {
> +      return BC_MSUBTYPE_WVC1;
> +   } else if (strcmp(name, "chdwmv3") == 0) {
> +      return BC_MSUBTYPE_WMV3;
> +   } else if (strcmp(name, "chdwmva") == 0) {
> +      return BC_MSUBTYPE_WMVA;
> +   } else if (strcmp(name, "chdh264") == 0) {
> +      return priv->is_avc ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264;
> +   } else {
> +      return BC_MSUBTYPE_INVALID;

switch?

Diego


More information about the MPlayer-dev-eng mailing list