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
a5155294
Commit
a5155294
authored
Jul 28, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pnm: do not set avctx->coded_frame
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
329221ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
29 deletions
+2
-29
pamenc.c
libavcodec/pamenc.c
+1
-7
pnm.c
libavcodec/pnm.c
+0
-10
pnm.h
libavcodec/pnm.h
+0
-2
pnmenc.c
libavcodec/pnmenc.c
+1
-10
No files found.
libavcodec/pamenc.c
View file @
a5155294
...
...
@@ -25,10 +25,9 @@
static
int
pam_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
p
ict
,
int
*
got_packet
)
const
AVFrame
*
p
,
int
*
got_packet
)
{
PNMContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
const
p
=
&
s
->
picture
;
int
i
,
h
,
w
,
n
,
linesize
,
depth
,
maxval
,
ret
;
const
char
*
tuple_type
;
uint8_t
*
ptr
;
...
...
@@ -91,10 +90,6 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
((
ret
=
ff_alloc_packet2
(
avctx
,
pkt
,
n
*
h
+
200
))
<
0
)
return
ret
;
*
p
=
*
pict
;
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
s
->
bytestream_start
=
s
->
bytestream
=
pkt
->
data
;
s
->
bytestream_end
=
pkt
->
data
+
pkt
->
size
;
...
...
@@ -134,7 +129,6 @@ AVCodec ff_pam_encoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_PAM
,
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode2
=
pam_encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_RGB48BE
,
AV_PIX_FMT_RGBA64BE
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_GRAY8A
,
AV_PIX_FMT_GRAY16BE
,
AV_PIX_FMT_MONOBLACK
,
AV_PIX_FMT_NONE
...
...
libavcodec/pnm.c
View file @
a5155294
...
...
@@ -196,13 +196,3 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
}
return
0
;
}
av_cold
int
ff_pnm_init
(
AVCodecContext
*
avctx
)
{
PNMContext
*
s
=
avctx
->
priv_data
;
avcodec_get_frame_defaults
(
&
s
->
picture
);
avctx
->
coded_frame
=
&
s
->
picture
;
return
0
;
}
libavcodec/pnm.h
View file @
a5155294
...
...
@@ -28,12 +28,10 @@ typedef struct PNMContext {
uint8_t
*
bytestream
;
uint8_t
*
bytestream_start
;
uint8_t
*
bytestream_end
;
AVFrame
picture
;
int
maxval
;
///< maximum value of a pixel
int
type
;
}
PNMContext
;
int
ff_pnm_decode_header
(
AVCodecContext
*
avctx
,
PNMContext
*
const
s
);
int
ff_pnm_init
(
AVCodecContext
*
avctx
);
#endif
/* AVCODEC_PNM_H */
libavcodec/pnmenc.c
View file @
a5155294
...
...
@@ -26,10 +26,9 @@
static
int
pnm_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
p
ict
,
int
*
got_packet
)
const
AVFrame
*
p
,
int
*
got_packet
)
{
PNMContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
const
p
=
&
s
->
picture
;
int
i
,
h
,
h1
,
c
,
n
,
linesize
,
ret
;
uint8_t
*
ptr
,
*
ptr1
,
*
ptr2
;
...
...
@@ -38,10 +37,6 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx
->
height
)
+
200
))
<
0
)
return
ret
;
*
p
=
*
pict
;
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
s
->
bytestream_start
=
s
->
bytestream
=
pkt
->
data
;
s
->
bytestream_end
=
pkt
->
data
+
pkt
->
size
;
...
...
@@ -132,7 +127,6 @@ AVCodec ff_pgm_encoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_PGM
,
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode2
=
pnm_encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_GRAY16BE
,
AV_PIX_FMT_NONE
...
...
@@ -147,7 +141,6 @@ AVCodec ff_pgmyuv_encoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_PGMYUV
,
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode2
=
pnm_encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV420P16BE
,
AV_PIX_FMT_NONE
...
...
@@ -162,7 +155,6 @@ AVCodec ff_ppm_encoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_PPM
,
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode2
=
pnm_encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGB48BE
,
AV_PIX_FMT_NONE
...
...
@@ -177,7 +169,6 @@ AVCodec ff_pbm_encoder = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_PBM
,
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode2
=
pnm_encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_MONOWHITE
,
AV_PIX_FMT_NONE
},
...
...
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