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
22f3e8be
Commit
22f3e8be
authored
Nov 15, 2002
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr1
Originally committed as revision 1216 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0626afe9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
huffyuv.c
libavcodec/huffyuv.c
+33
-14
No files found.
libavcodec/huffyuv.c
View file @
22f3e8be
...
...
@@ -412,16 +412,18 @@ s->bgr32=1;
y_size
=
height
*
stride
;
s
->
linesize
[
0
]
=
stride
;
s
->
picture
[
0
]
=
av_mallocz
(
y_size
);
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_DR1
)){
s
->
linesize
[
0
]
=
stride
;
s
->
picture
[
0
]
=
av_mallocz
(
y_size
);
if
(
c_size
){
s
->
picture
[
1
]
=
av_mallocz
(
c_size
);
s
->
picture
[
2
]
=
av_mallocz
(
c_size
);
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
stride
/
2
;
if
(
c_size
){
s
->
picture
[
1
]
=
av_mallocz
(
c_size
);
s
->
picture
[
2
]
=
av_mallocz
(
c_size
);
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
stride
/
2
;
memset
(
s
->
picture
[
1
],
128
,
c_size
);
memset
(
s
->
picture
[
2
],
128
,
c_size
);
memset
(
s
->
picture
[
1
],
128
,
c_size
);
memset
(
s
->
picture
[
2
],
128
,
c_size
);
}
}
// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
...
...
@@ -651,9 +653,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
const
int
width
=
s
->
width
;
const
int
width2
=
s
->
width
>>
1
;
const
int
height
=
s
->
height
;
const
int
fake_ystride
=
s
->
interlaced
?
s
->
linesize
[
0
]
*
2
:
s
->
linesize
[
0
];
const
int
fake_ustride
=
s
->
interlaced
?
s
->
linesize
[
1
]
*
2
:
s
->
linesize
[
1
];
const
int
fake_vstride
=
s
->
interlaced
?
s
->
linesize
[
2
]
*
2
:
s
->
linesize
[
2
];
int
fake_ystride
,
fake_ustride
,
fake_vstride
;
int
i
;
AVPicture
*
picture
=
data
;
...
...
@@ -667,7 +667,24 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
bswap_buf
((
uint32_t
*
)
s
->
bitstream_buffer
,
(
uint32_t
*
)
buf
,
buf_size
/
4
);
init_get_bits
(
&
s
->
gb
,
s
->
bitstream_buffer
,
buf_size
);
if
(
avctx
->
flags
&
CODEC_FLAG_DR1
){
if
(
avctx
->
get_buffer_callback
(
avctx
,
s
->
width
,
s
->
height
,
I_TYPE
)
<
0
){
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
return
-
1
;
}
s
->
linesize
[
0
]
=
avctx
->
dr_stride
;
s
->
linesize
[
1
]
=
s
->
linesize
[
2
]
=
avctx
->
dr_uvstride
;
for
(
i
=
0
;
i
<
3
;
i
++
)
s
->
picture
[
i
]
=
avctx
->
dr_buffer
[
i
];
}
fake_ystride
=
s
->
interlaced
?
s
->
linesize
[
0
]
*
2
:
s
->
linesize
[
0
];
fake_ustride
=
s
->
interlaced
?
s
->
linesize
[
1
]
*
2
:
s
->
linesize
[
1
];
fake_vstride
=
s
->
interlaced
?
s
->
linesize
[
2
]
*
2
:
s
->
linesize
[
2
];
if
(
s
->
bitstream_bpp
<
24
){
int
y
,
cy
;
int
lefty
,
leftu
,
leftv
;
...
...
@@ -870,7 +887,9 @@ static int decode_end(AVCodecContext *avctx)
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
){
av_freep
(
&
s
->
picture
[
i
]);
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_DR1
))
av_freep
(
&
s
->
picture
[
i
]);
free_vlc
(
&
s
->
vlc
[
i
]);
}
...
...
@@ -1050,7 +1069,7 @@ AVCodec huffyuv_decoder = {
NULL
,
decode_end
,
decode_frame
,
0
,
CODEC_CAP_DR1
,
NULL
};
...
...
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