Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1f0c7020
Commit
1f0c7020
authored
Aug 27, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpegdec: add 'extern_huff' private option.
Deprecate CODEC_FLAG_EXTERN_HUFF
parent
4623420d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
0 deletions
+32
-0
avcodec.h
libavcodec/avcodec.h
+2
-0
mjpegdec.c
libavcodec/mjpegdec.c
+20
-0
mjpegdec.h
libavcodec/mjpegdec.h
+5
-0
options.c
libavcodec/options.c
+2
-0
version.h
libavcodec/version.h
+3
-0
No files found.
libavcodec/avcodec.h
View file @
1f0c7020
...
@@ -581,7 +581,9 @@ typedef struct RcOverride{
...
@@ -581,7 +581,9 @@ typedef struct RcOverride{
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
#if FF_API_MJPEG_GLOBAL_OPTS
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
#endif
#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
...
...
libavcodec/mjpegdec.c
View file @
1f0c7020
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <assert.h>
#include <assert.h>
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "avcodec.h"
#include "dsputil.h"
#include "dsputil.h"
#include "mjpeg.h"
#include "mjpeg.h"
...
@@ -96,7 +97,11 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
...
@@ -96,7 +97,11 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
build_basic_mjpeg_vlc
(
s
);
build_basic_mjpeg_vlc
(
s
);
#if FF_API_MJPEG_GLOBAL_OPTS
if
(
avctx
->
flags
&
CODEC_FLAG_EXTERN_HUFF
)
if
(
avctx
->
flags
&
CODEC_FLAG_EXTERN_HUFF
)
s
->
extern_huff
=
1
;
#endif
if
(
s
->
extern_huff
)
{
{
av_log
(
avctx
,
AV_LOG_INFO
,
"mjpeg: using external huffman table
\n
"
);
av_log
(
avctx
,
AV_LOG_INFO
,
"mjpeg: using external huffman table
\n
"
);
init_get_bits
(
&
s
->
gb
,
avctx
->
extradata
,
avctx
->
extradata_size
*
8
);
init_get_bits
(
&
s
->
gb
,
avctx
->
extradata
,
avctx
->
extradata_size
*
8
);
...
@@ -1597,6 +1602,20 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
...
@@ -1597,6 +1602,20 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
#define OFFSET(x) offsetof(MJpegDecodeContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static
const
AVOption
options
[]
=
{
{
"extern_huff"
,
"Use external huffman table."
,
OFFSET
(
extern_huff
),
FF_OPT_TYPE_INT
,
{
0
},
0
,
1
,
VD
},
{
NULL
},
};
static
const
AVClass
mjpegdec_class
=
{
.
class_name
=
"MJPEG decoder"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_mjpeg_decoder
=
{
AVCodec
ff_mjpeg_decoder
=
{
.
name
=
"mjpeg"
,
.
name
=
"mjpeg"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -1608,6 +1627,7 @@ AVCodec ff_mjpeg_decoder = {
...
@@ -1608,6 +1627,7 @@ AVCodec ff_mjpeg_decoder = {
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
max_lowres
=
3
,
.
max_lowres
=
3
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"MJPEG (Motion JPEG)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"MJPEG (Motion JPEG)"
),
.
priv_class
=
&
mjpegdec_class
,
};
};
AVCodec
ff_thp_decoder
=
{
AVCodec
ff_thp_decoder
=
{
...
...
libavcodec/mjpegdec.h
View file @
1f0c7020
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#ifndef AVCODEC_MJPEGDEC_H
#ifndef AVCODEC_MJPEGDEC_H
#define AVCODEC_MJPEGDEC_H
#define AVCODEC_MJPEGDEC_H
#include "libavutil/log.h"
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
#include "dsputil.h"
#include "dsputil.h"
...
@@ -36,6 +38,7 @@
...
@@ -36,6 +38,7 @@
#define MAX_COMPONENTS 4
#define MAX_COMPONENTS 4
typedef
struct
MJpegDecodeContext
{
typedef
struct
MJpegDecodeContext
{
AVClass
*
class
;
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
GetBitContext
gb
;
GetBitContext
gb
;
...
@@ -106,6 +109,8 @@ typedef struct MJpegDecodeContext {
...
@@ -106,6 +109,8 @@ typedef struct MJpegDecodeContext {
uint16_t
(
*
ljpeg_buffer
)[
4
];
uint16_t
(
*
ljpeg_buffer
)[
4
];
unsigned
int
ljpeg_buffer_size
;
unsigned
int
ljpeg_buffer_size
;
int
extern_huff
;
}
MJpegDecodeContext
;
}
MJpegDecodeContext
;
int
ff_mjpeg_decode_init
(
AVCodecContext
*
avctx
);
int
ff_mjpeg_decode_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/options.c
View file @
1f0c7020
...
@@ -87,7 +87,9 @@ static const AVOption options[]={
...
@@ -87,7 +87,9 @@ static const AVOption options[]={
{
"input_preserved"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_INPUT_PRESERVED
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"input_preserved"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_INPUT_PRESERVED
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass1"
,
"use internal 2pass ratecontrol in first pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS1
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass1"
,
"use internal 2pass ratecontrol in first pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS1
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass2"
,
"use internal 2pass ratecontrol in second pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS2
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass2"
,
"use internal 2pass ratecontrol in second pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS2
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
#if FF_API_MJPEG_GLOBAL_OPTS
{
"extern_huff"
,
"use external huffman table (for mjpeg)"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_EXTERN_HUFF
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"extern_huff"
,
"use external huffman table (for mjpeg)"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_EXTERN_HUFF
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
#endif
{
"gray"
,
"only decode/encode grayscale"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_GRAY
},
INT_MIN
,
INT_MAX
,
V
|
E
|
D
,
"flags"
},
{
"gray"
,
"only decode/encode grayscale"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_GRAY
},
INT_MIN
,
INT_MAX
,
V
|
E
|
D
,
"flags"
},
{
"emu_edge"
,
"don't draw edges"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_EMU_EDGE
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"emu_edge"
,
"don't draw edges"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_EMU_EDGE
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"psnr"
,
"error[?] variables will be set during encoding"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PSNR
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
{
"psnr"
,
"error[?] variables will be set during encoding"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PSNR
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
...
...
libavcodec/version.h
View file @
1f0c7020
...
@@ -95,5 +95,8 @@
...
@@ -95,5 +95,8 @@
#ifndef FF_API_SNOW_GLOBAL_OPTS
#ifndef FF_API_SNOW_GLOBAL_OPTS
#define FF_API_SNOW_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
#define FF_API_SNOW_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#endif
#ifndef FF_API_MJPEG_GLOBAL_OPTS
#define FF_API_MJPEG_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#endif
/* AVCODEC_VERSION_H */
#endif
/* AVCODEC_VERSION_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment