Skip to content

Commit

Permalink
RoQ video encoder
Browse files Browse the repository at this point in the history
patch by Vitor: \vitor1001 gmail com/
original thread: [FFmpeg-devel] RoQ video encoder (take 3)
date: 06/08/2007 10:34 PM

Originally committed as revision 9420 to svn://svn.ffmpeg.org/ffmpeg/trunk
  • Loading branch information
Vitor Sessak authored and Benoit Fouet committed Jun 25, 2007
1 parent 606975a commit 03e3e76
Show file tree
Hide file tree
Showing 7 changed files with 1,087 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog
Expand Up @@ -87,6 +87,7 @@ version <next>
- extern C declarations for C++ removed from headers
- sws_flags command line option
- codebook generator
- RoQ video encoder

version 0.4.9-pre1:

Expand Down
2 changes: 1 addition & 1 deletion doc/ffmpeg-doc.texi
Expand Up @@ -1027,7 +1027,7 @@ following image formats are supported:
@item Cirrus Logic AccuPak @tab @tab X @tab fourcc: CLJR
@item 4X Video @tab @tab X @tab Used in certain computer games.
@item Sony Playstation MDEC @tab @tab X
@item Id RoQ @tab @tab X @tab Used in Quake III, Jedi Knight 2, other computer games.
@item Id RoQ @tab X @tab X @tab Used in Quake III, Jedi Knight 2, other computer games.
@item Xan/WC3 @tab @tab X @tab Used in Wing Commander III .MVE files.
@item Interplay Video @tab @tab X @tab Used in Interplay .MVE files.
@item Apple Animation @tab @tab X @tab fourcc: 'rle '
Expand Down
1 change: 1 addition & 0 deletions libavcodec/Makefile
Expand Up @@ -135,6 +135,7 @@ OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
OBJS-$(CONFIG_RA_144_DECODER) += ra144.o
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o
OBJS-$(CONFIG_ROQ_DECODER) += roqvideodec.o roqvideo.o
OBJS-$(CONFIG_ROQ_ENCODER) += roqvideoenc.o roqvideo.o elbg.o
OBJS-$(CONFIG_ROQ_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_ROQ_DPCM_ENCODER) += roqaudioenc.o
OBJS-$(CONFIG_RPZA_DECODER) += rpza.o
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/allcodecs.c
Expand Up @@ -124,7 +124,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(QPEG, qpeg);
REGISTER_DECODER(QTRLE, qtrle);
REGISTER_ENCDEC (RAWVIDEO, rawvideo);
REGISTER_DECODER(ROQ, roq);
REGISTER_ENCDEC (ROQ, roq);
REGISTER_DECODER(RPZA, rpza);
REGISTER_ENCDEC (RV10, rv10);
REGISTER_ENCDEC (RV20, rv20);
Expand Down
1 change: 1 addition & 0 deletions libavcodec/allcodecs.h
Expand Up @@ -57,6 +57,7 @@ extern AVCodec pgmyuv_encoder;
extern AVCodec png_encoder;
extern AVCodec ppm_encoder;
extern AVCodec roq_dpcm_encoder;
extern AVCodec roq_encoder;
extern AVCodec rv10_encoder;
extern AVCodec rv20_encoder;
extern AVCodec sgi_encoder;
Expand Down
21 changes: 21 additions & 0 deletions libavcodec/roqvideo.h
Expand Up @@ -24,6 +24,7 @@

#include "avcodec.h"
#include "dsputil.h"
#include "random.h"

typedef struct {
unsigned char y[4];
Expand All @@ -34,13 +35,18 @@ typedef struct {
int idx[4];
} roq_qcell;

typedef struct {
int d[2];
} motion_vect;

typedef struct RoqContext {

AVCodecContext *avctx;
DSPContext dsp;
AVFrame frames[2];
AVFrame *last_frame;
AVFrame *current_frame;
int first_frame;
int y_stride;
int c_stride;

Expand All @@ -49,7 +55,22 @@ typedef struct RoqContext {

unsigned char *buf;
int size;
int width, height;

/* Encoder only data */
AVRandomState randctx;
uint64_t lambda;

motion_vect *this_motion4;
motion_vect *last_motion4;

motion_vect *this_motion8;
motion_vect *last_motion8;

unsigned int framesSinceKeyframe;

AVFrame *frame_to_enc;
uint8_t *out_buf;
} RoqContext;

#define RoQ_INFO 0x1001
Expand Down

0 comments on commit 03e3e76

Please sign in to comment.