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
d87d5025
Commit
d87d5025
authored
Sep 05, 2009
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prettyprinting cosmetics
Originally committed as revision 19767 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
bbb0bdd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
v210dec.c
libavcodec/v210dec.c
+10
-9
v210enc.c
libavcodec/v210enc.c
+5
-4
No files found.
libavcodec/v210dec.c
View file @
d87d5025
...
...
@@ -32,15 +32,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
if
(
avcodec_check_dimensions
(
avctx
,
avctx
->
width
,
avctx
->
height
)
<
0
)
return
-
1
;
avctx
->
pix_fmt
=
PIX_FMT_YUV422P16
;
avctx
->
pix_fmt
=
PIX_FMT_YUV422P16
;
avctx
->
bits_per_raw_sample
=
10
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
=
avcodec_alloc_frame
();
return
0
;
}
static
int
decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
static
int
decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
{
int
h
,
w
;
AVFrame
*
pic
=
avctx
->
coded_frame
;
...
...
@@ -67,9 +68,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
pic
->
pict_type
=
FF_I_TYPE
;
pic
->
key_frame
=
1
;
#define READ_PIXELS(a, b, c) \
do { \
val
= le2me_32(*src++);
\
#define READ_PIXELS(a, b, c)
\
do {
\
val
= le2me_32(*src++);
\
*a++ = val << 6; \
*b++ = (val >> 4) & 0xFFC0; \
*c++ = (val >> 14) & 0xFFC0; \
...
...
@@ -100,9 +101,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
psrc
+=
stride
;
y
+=
pic
->
linesize
[
0
]
/
2
-
avctx
->
width
;
u
+=
pic
->
linesize
[
1
]
/
2
-
avctx
->
width
/
2
;
v
+=
pic
->
linesize
[
2
]
/
2
-
avctx
->
width
/
2
;
y
+=
pic
->
linesize
[
0
]
/
2
-
avctx
->
width
;
u
+=
pic
->
linesize
[
1
]
/
2
-
avctx
->
width
/
2
;
v
+=
pic
->
linesize
[
2
]
/
2
-
avctx
->
width
/
2
;
}
*
data_size
=
sizeof
(
AVFrame
);
...
...
libavcodec/v210enc.c
View file @
d87d5025
...
...
@@ -48,7 +48,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
return
0
;
}
static
int
encode_frame
(
AVCodecContext
*
avctx
,
unsigned
char
*
buf
,
int
buf_size
,
void
*
data
)
static
int
encode_frame
(
AVCodecContext
*
avctx
,
unsigned
char
*
buf
,
int
buf_size
,
void
*
data
)
{
const
AVFrame
*
pic
=
data
;
int
aligned_width
=
((
avctx
->
width
+
47
)
/
48
)
*
48
;
...
...
@@ -101,9 +102,9 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
pdst
+=
stride
;
memset
(
p
,
0
,
pdst
-
p
);
p
=
pdst
;
y
+=
pic
->
linesize
[
0
]
/
2
-
avctx
->
width
;
u
+=
pic
->
linesize
[
1
]
/
2
-
avctx
->
width
/
2
;
v
+=
pic
->
linesize
[
2
]
/
2
-
avctx
->
width
/
2
;
y
+=
pic
->
linesize
[
0
]
/
2
-
avctx
->
width
;
u
+=
pic
->
linesize
[
1
]
/
2
-
avctx
->
width
/
2
;
v
+=
pic
->
linesize
[
2
]
/
2
-
avctx
->
width
/
2
;
}
return
p
-
buf
;
...
...
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