Commit 35c6ce76 authored by Vittorio Giovara's avatar Vittorio Giovara

Canopus HQX decoder

Based on work by Kostya Shishkov <kostya.shishkov@gmail.com>.
parent 36a6fb98
......@@ -19,6 +19,7 @@ version <next>:
- RTP depacketizer for AC3 payload format (RFC 4184)
- RTP depacketizer for loss tolerant payload format for MP3 audio (RFC 5219)
- RTP depacketizer for DV (RFC 6469)
- Canopus HQX decoder
version 11:
......
......@@ -222,6 +222,7 @@ library:
@item Delphine Software International CIN @tab @tab X
@tab Multimedia format used by Delphine Software games.
@item Digital Speech Standard (DSS) @tab @tab X
@item Canopus HQX @tab @tab X
@item CD+G @tab @tab X
@tab Video format used by CD+G karaoke disks
@item Commodore CDXL @tab @tab X
......
......@@ -227,6 +227,7 @@ OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o
hevc_cabac.o hevc_refs.o hevcpred.o \
hevcdsp.o hevc_filter.o
OBJS-$(CONFIG_HNM4_VIDEO_DECODER) += hnm4video.o
OBJS-$(CONFIG_HQX_DECODER) += hqx.o hqxvlc.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
......
......@@ -164,6 +164,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(H264_QSV, h264_qsv);
REGISTER_DECODER(HEVC, hevc);
REGISTER_DECODER(HNM4_VIDEO, hnm4_video);
REGISTER_DECODER(HQX, hqx);
REGISTER_ENCDEC (HUFFYUV, huffyuv);
REGISTER_DECODER(IDCIN, idcin);
REGISTER_DECODER(IFF_BYTERUN1, iff_byterun1);
......
......@@ -293,6 +293,7 @@ enum AVCodecID {
AV_CODEC_ID_SGIRLE,
AV_CODEC_ID_MVC1,
AV_CODEC_ID_MVC2,
AV_CODEC_ID_HQX,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
......
......@@ -1134,6 +1134,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("SGI RLE 8-bit"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
.id = AV_CODEC_ID_HQX,
.type = AVMEDIA_TYPE_VIDEO,
.name = "hqx",
.long_name = NULL_IF_CONFIG_SMALL("Canopus HQX"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
/* image codecs */
{
......
This diff is collapsed.
/*
* Canopus HQX decoder
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_HQX_H
#define AVCODEC_HQX_H
#include <stdint.h>
#include "libavutil/mem.h"
#include "get_bits.h"
enum HQXACMode {
HQX_AC_Q0 = 0,
HQX_AC_Q8,
HQX_AC_Q16,
HQX_AC_Q32,
HQX_AC_Q64,
HQX_AC_Q128,
NUM_HQX_AC
};
typedef struct HQXLUT {
int16_t lev;
uint8_t run;
int8_t bits;
} HQXLUT;
typedef struct HQXAC {
int lut_bits, extra_bits;
const HQXLUT *lut;
} HQXAC;
typedef struct HQXContext {
int format, dcb, width, height;
int interlaced;
DECLARE_ALIGNED(16, int16_t, block)[16][64];
VLC cbp_vlc;
VLC dc_vlc[3];
} HQXContext;
#define HQX_DC_VLC_BITS 9
extern const HQXAC ff_hqx_ac[NUM_HQX_AC];
int ff_hqx_init_vlcs(HQXContext *ctx);
#endif /* AVCODEC_HQX_H */
This diff is collapsed.
......@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 16
#define LIBAVCODEC_VERSION_MINOR 17
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
......@@ -351,6 +351,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_PRORES, MKTAG('A', 'P', 'C', 'N') },
{ AV_CODEC_ID_PRORES, MKTAG('A', 'P', 'C', 'H') },
{ AV_CODEC_ID_QTRLE, MKTAG('r', 'l', 'e', ' ') },
{ AV_CODEC_ID_HQX, MKTAG('C', 'H', 'Q', 'X') },
{ AV_CODEC_ID_NONE, 0 }
};
......
......@@ -52,6 +52,15 @@ fate-bink-video: $(FATE_BINK_VIDEO)
FATE_SAMPLES_AVCONV-$(call DEMDEC, BMV, BMV_VIDEO) += fate-bmv-video
fate-bmv-video: CMD = framecrc -i $(TARGET_SAMPLES)/bmv/SURFING-partial.BMV -pix_fmt rgb24 -an
FATE_CANOPUS_HQX += fate-canopus-hqx422
fate-canopus-hqx422: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422.avi -pix_fmt yuv422p16be -an
FATE_CANOPUS_HQX += fate-canopus-hqx422a
fate-canopus-hqx422a: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422a.avi -pix_fmt yuv422p16be -an
FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, HQX) += $(FATE_CANOPUS_HQX)
fate-canopus-hqx: $(FATE_CANOPUS_HQX)
FATE_SAMPLES_AVCONV-$(call DEMDEC, MPEGPS, CAVS) += fate-cavs
fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg -an
......
#tb 0: 1/25
0, 0, 0, 1, 1658880, 0x823fcbac
#tb 0: 1/25
0, 0, 0, 1, 8294400, 0x9b38264d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment