Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e63b818d
Commit
e63b818d
authored
Feb 07, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dv: Properly split decoder and encoder initialization
parent
d2869aea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
19 deletions
+31
-19
dv.c
libavcodec/dv.c
+0
-18
dvdec.c
libavcodec/dvdec.c
+20
-1
dvenc.c
libavcodec/dvenc.c
+11
-0
No files found.
libavcodec/dv.c
View file @
e63b818d
...
...
@@ -235,7 +235,6 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const DVprofile *d)
av_cold
int
ff_dvvideo_init
(
AVCodecContext
*
avctx
)
{
DVVideoContext
*
s
=
avctx
->
priv_data
;
DSPContext
dsp
;
static
int
done
=
0
;
int
i
,
j
;
...
...
@@ -292,23 +291,6 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
ff_free_vlc
(
&
dv_vlc
);
}
/* Generic DSP setup */
ff_dsputil_init
(
&
dsp
,
avctx
);
ff_set_cmp
(
&
dsp
,
dsp
.
ildct_cmp
,
avctx
->
ildct_cmp
);
s
->
get_pixels
=
dsp
.
get_pixels
;
s
->
ildct_cmp
=
dsp
.
ildct_cmp
[
5
];
/* 88DCT setup */
s
->
fdct
[
0
]
=
dsp
.
fdct
;
s
->
idct_put
[
0
]
=
dsp
.
idct_put
;
for
(
i
=
0
;
i
<
64
;
i
++
)
s
->
dv_zigzag
[
0
][
i
]
=
dsp
.
idct_permutation
[
ff_zigzag_direct
[
i
]];
/* 248DCT setup */
s
->
fdct
[
1
]
=
dsp
.
fdct248
;
s
->
idct_put
[
1
]
=
ff_simple_idct248_put
;
// FIXME: need to add it to DSP
memcpy
(
s
->
dv_zigzag
[
1
],
ff_dv_zigzag248_direct
,
sizeof
(
s
->
dv_zigzag
[
1
]));
s
->
avctx
=
avctx
;
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_TOPLEFT
;
...
...
libavcodec/dvdec.c
View file @
e63b818d
...
...
@@ -58,6 +58,25 @@ typedef struct BlockInfo {
static
const
int
dv_iweight_bits
=
14
;
static
av_cold
int
dvvideo_decode_init
(
AVCodecContext
*
avctx
)
{
DVVideoContext
*
s
=
avctx
->
priv_data
;
DSPContext
dsp
;
int
i
;
ff_dsputil_init
(
&
dsp
,
avctx
);
for
(
i
=
0
;
i
<
64
;
i
++
)
s
->
dv_zigzag
[
0
][
i
]
=
dsp
.
idct_permutation
[
ff_zigzag_direct
[
i
]];
memcpy
(
s
->
dv_zigzag
[
1
],
ff_dv_zigzag248_direct
,
sizeof
(
s
->
dv_zigzag
[
1
]));
s
->
idct_put
[
0
]
=
dsp
.
idct_put
;
s
->
idct_put
[
1
]
=
ff_simple_idct248_put
;
return
ff_dvvideo_init
(
avctx
);
}
/* decode AC coefficients */
static
void
dv_decode_ac
(
GetBitContext
*
gb
,
BlockInfo
*
mb
,
int16_t
*
block
)
{
...
...
@@ -381,7 +400,7 @@ AVCodec ff_dvvideo_decoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_DVVIDEO
,
.
priv_data_size
=
sizeof
(
DVVideoContext
),
.
init
=
ff_dvvideo
_init
,
.
init
=
dvvideo_decode
_init
,
.
decode
=
dvvideo_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
|
CODEC_CAP_SLICE_THREADS
,
};
libavcodec/dvenc.c
View file @
e63b818d
...
...
@@ -28,6 +28,7 @@
#include "libavutil/pixdesc.h"
#include "config.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "put_bits.h"
#include "dv.h"
...
...
@@ -36,6 +37,7 @@
static
av_cold
int
dvvideo_encode_init
(
AVCodecContext
*
avctx
)
{
DVVideoContext
*
s
=
avctx
->
priv_data
;
DSPContext
dsp
;
int
ret
;
s
->
sys
=
avpriv_dv_codec_profile
(
avctx
);
...
...
@@ -58,6 +60,15 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
dv_vlc_map_tableinit
();
ff_dsputil_init
(
&
dsp
,
avctx
);
ff_set_cmp
(
&
dsp
,
dsp
.
ildct_cmp
,
avctx
->
ildct_cmp
);
s
->
get_pixels
=
dsp
.
get_pixels
;
s
->
ildct_cmp
=
dsp
.
ildct_cmp
[
5
];
s
->
fdct
[
0
]
=
dsp
.
fdct
;
s
->
fdct
[
1
]
=
dsp
.
fdct248
;
return
ff_dvvideo_init
(
avctx
);
}
...
...
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