Browse Source

mjpeg: Move code only used in the encoder(s) to the appropriate header

tags/n2.7
Diego Biurrun 10 years ago
parent
commit
e6e3dcba0c
5 changed files with 10 additions and 7 deletions
  1. +1
    -0
      libavcodec/jpeglsenc.c
  2. +0
    -7
      libavcodec/mjpeg.h
  3. +1
    -0
      libavcodec/mjpegdec.c
  4. +7
    -0
      libavcodec/mjpegenc.h
  5. +1
    -0
      libavcodec/mjpegenc_common.c

+ 1
- 0
libavcodec/jpeglsenc.c View File

@@ -31,6 +31,7 @@
#include "internal.h"
#include "mathops.h"
#include "mjpeg.h"
#include "mjpegenc.h"
#include "jpegls.h"

/**


+ 0
- 7
libavcodec/mjpeg.h View File

@@ -36,7 +36,6 @@
#include "libavutil/internal.h"

#include "avcodec.h"
#include "put_bits.h"

/* JPEG marker codes */
typedef enum {
@@ -120,12 +119,6 @@ typedef enum {
/* 0x02 -> 0xbf reserved */
} JPEG_MARKER;

static inline void put_marker(PutBitContext *p, int code)
{
put_bits(p, 8, 0xff);
put_bits(p, 8, code);
}

#define PREDICT(ret, topleft, top, left, predictor)\
switch(predictor){\
case 1: ret= left; break;\


+ 1
- 0
libavcodec/mjpegdec.c View File

@@ -41,6 +41,7 @@
#include "mjpeg.h"
#include "mjpegdec.h"
#include "jpeglsdec.h"
#include "put_bits.h"


static int build_vlc(VLC *vlc, const uint8_t *bits_table,


+ 7
- 0
libavcodec/mjpegenc.h View File

@@ -36,6 +36,7 @@
#include <stdint.h>

#include "mpegvideo.h"
#include "put_bits.h"

typedef struct MJpegContext {
uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
@@ -49,6 +50,12 @@ typedef struct MJpegContext {
uint16_t huff_code_ac_chrominance[256];
} MJpegContext;

static inline void put_marker(PutBitContext *p, int code)
{
put_bits(p, 8, 0xff);
put_bits(p, 8, code);
}

int ff_mjpeg_encode_init(MpegEncContext *s);
void ff_mjpeg_encode_close(MpegEncContext *s);
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[8][64]);


+ 1
- 0
libavcodec/mjpegenc_common.c View File

@@ -28,6 +28,7 @@
#include "avcodec.h"
#include "idctdsp.h"
#include "put_bits.h"
#include "mjpegenc.h"
#include "mjpegenc_common.h"
#include "mjpeg.h"



Loading…
Cancel
Save