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
da22ba7d
Commit
da22ba7d
authored
Oct 19, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12: move full_pel from MpegEncContext to Mpeg1Context
It's MPEG-1 specific.
parent
cc05a45d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
mpeg12.c
libavcodec/mpeg12.c
+8
-7
mpeg12.h
libavcodec/mpeg12.h
+1
-0
mpegvideo.h
libavcodec/mpegvideo.h
+0
-1
vdpau.c
libavcodec/vdpau.c
+4
-3
vdpau_internal.h
libavcodec/vdpau_internal.h
+2
-1
No files found.
libavcodec/mpeg12.c
View file @
da22ba7d
...
...
@@ -734,8 +734,9 @@ static void exchange_uv(MpegEncContext *s)
#define MT_16X8 2
#define MT_DMV 3
static
int
mpeg_decode_mb
(
Mpeg
EncContext
*
s
,
DCTELEM
block
[
12
][
64
])
static
int
mpeg_decode_mb
(
Mpeg
1Context
*
s1
,
DCTELEM
block
[
12
][
64
])
{
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
int
i
,
j
,
k
,
cbp
,
val
,
mb_type
,
motion_type
;
const
int
mb_block_count
=
4
+
(
1
<<
s
->
chroma_format
);
...
...
@@ -909,7 +910,7 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
s
->
mv
[
i
][
0
][
1
]
=
s
->
last_mv
[
i
][
0
][
1
]
=
s
->
last_mv
[
i
][
1
][
1
]
=
mpeg_decode_motion
(
s
,
s
->
mpeg_f_code
[
i
][
1
],
s
->
last_mv
[
i
][
0
][
1
]);
/* full_pel: only for MPEG-1 */
if
(
s
->
full_pel
[
i
])
{
if
(
s
1
->
full_pel
[
i
])
{
s
->
mv
[
i
][
0
][
0
]
<<=
1
;
s
->
mv
[
i
][
0
][
1
]
<<=
1
;
}
...
...
@@ -1327,7 +1328,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
vbv_delay
=
get_bits
(
&
s
->
gb
,
16
);
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_P
||
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
{
s
->
full_pel
[
0
]
=
get_bits1
(
&
s
->
gb
);
s
1
->
full_pel
[
0
]
=
get_bits1
(
&
s
->
gb
);
f_code
=
get_bits
(
&
s
->
gb
,
3
);
if
(
f_code
==
0
&&
(
avctx
->
err_recognition
&
AV_EF_BITSTREAM
))
return
-
1
;
...
...
@@ -1335,7 +1336,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
s
->
mpeg_f_code
[
0
][
1
]
=
f_code
;
}
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
{
s
->
full_pel
[
1
]
=
get_bits1
(
&
s
->
gb
);
s
1
->
full_pel
[
1
]
=
get_bits1
(
&
s
->
gb
);
f_code
=
get_bits
(
&
s
->
gb
,
3
);
if
(
f_code
==
0
&&
(
avctx
->
err_recognition
&
AV_EF_BITSTREAM
))
return
-
1
;
...
...
@@ -1483,7 +1484,7 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
{
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
s
->
full_pel
[
0
]
=
s
->
full_pel
[
1
]
=
0
;
s
1
->
full_pel
[
0
]
=
s1
->
full_pel
[
1
]
=
0
;
s
->
mpeg_f_code
[
0
][
0
]
=
get_bits
(
&
s
->
gb
,
4
);
s
->
mpeg_f_code
[
0
][
1
]
=
get_bits
(
&
s
->
gb
,
4
);
s
->
mpeg_f_code
[
1
][
0
]
=
get_bits
(
&
s
->
gb
,
4
);
...
...
@@ -1715,7 +1716,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
if
(
CONFIG_MPEG_XVMC_DECODER
&&
s
->
avctx
->
xvmc_acceleration
>
1
)
ff_xvmc_init_block
(
s
);
// set s->block
if
(
mpeg_decode_mb
(
s
,
s
->
block
)
<
0
)
if
(
mpeg_decode_mb
(
s
1
,
s
->
block
)
<
0
)
return
-
1
;
if
(
s
->
current_picture
.
f
.
motion_val
[
0
]
&&
!
s
->
encoding
)
{
// note motion_val is normally NULL unless we want to extract the MVs
...
...
@@ -2258,7 +2259,7 @@ static int decode_chunks(AVCodecContext *avctx,
}
if
(
CONFIG_MPEG_VDPAU_DECODER
&&
avctx
->
codec
->
capabilities
&
CODEC_CAP_HWACCEL_VDPAU
)
ff_vdpau_mpeg_picture_complete
(
s
2
,
buf
,
buf_size
,
s
->
slice_count
);
ff_vdpau_mpeg_picture_complete
(
s
,
buf
,
buf_size
,
s
->
slice_count
);
if
(
slice_end
(
avctx
,
picture
))
{
if
(
s2
->
last_picture_ptr
||
s2
->
low_delay
)
//FIXME merge with the stuff in mpeg_decode_slice
...
...
libavcodec/mpeg12.h
View file @
da22ba7d
...
...
@@ -41,6 +41,7 @@ typedef struct Mpeg1Context {
int
save_width
,
save_height
,
save_progressive_seq
;
AVRational
frame_rate_ext
;
///< MPEG-2 specific framerate modificator
int
sync
;
///< Did we reach a sync point like a GOP/SEQ/KEYFrame?
int
full_pel
[
2
];
}
Mpeg1Context
;
extern
uint8_t
ff_mpeg12_static_rl_table_store
[
2
][
2
][
2
*
MAX_RUN
+
MAX_LEVEL
+
3
];
...
...
libavcodec/mpegvideo.h
View file @
da22ba7d
...
...
@@ -634,7 +634,6 @@ typedef struct MpegEncContext {
int
chroma_y_shift
;
int
progressive_frame
;
int
full_pel
[
2
];
int
interlaced_dct
;
int
first_slice
;
int
first_field
;
///< is 1 for the first field of a field picture 0 otherwise
...
...
libavcodec/vdpau.c
View file @
da22ba7d
...
...
@@ -190,9 +190,10 @@ void ff_vdpau_h264_picture_complete(MpegEncContext *s)
render
->
bitstream_buffers_used
=
0
;
}
void
ff_vdpau_mpeg_picture_complete
(
Mpeg
EncContext
*
s
,
const
uint8_t
*
buf
,
void
ff_vdpau_mpeg_picture_complete
(
Mpeg
1Context
*
s1
,
const
uint8_t
*
buf
,
int
buf_size
,
int
slice_count
)
{
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
struct
vdpau_render_state
*
render
,
*
last
,
*
next
;
int
i
;
...
...
@@ -211,8 +212,8 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
render
->
info
.
mpeg
.
alternate_scan
=
s
->
alternate_scan
;
render
->
info
.
mpeg
.
q_scale_type
=
s
->
q_scale_type
;
render
->
info
.
mpeg
.
top_field_first
=
s
->
top_field_first
;
render
->
info
.
mpeg
.
full_pel_forward_vector
=
s
->
full_pel
[
0
];
// MPEG-1 only. Set 0 for MPEG-2
render
->
info
.
mpeg
.
full_pel_backward_vector
=
s
->
full_pel
[
1
];
// MPEG-1 only. Set 0 for MPEG-2
render
->
info
.
mpeg
.
full_pel_forward_vector
=
s
1
->
full_pel
[
0
];
// MPEG-1 only. Set 0 for MPEG-2
render
->
info
.
mpeg
.
full_pel_backward_vector
=
s
1
->
full_pel
[
1
];
// MPEG-1 only. Set 0 for MPEG-2
render
->
info
.
mpeg
.
f_code
[
0
][
0
]
=
s
->
mpeg_f_code
[
0
][
0
];
// For MPEG-1 fill both horiz. & vert.
render
->
info
.
mpeg
.
f_code
[
0
][
1
]
=
s
->
mpeg_f_code
[
0
][
1
];
render
->
info
.
mpeg
.
f_code
[
1
][
0
]
=
s
->
mpeg_f_code
[
1
][
0
];
...
...
libavcodec/vdpau_internal.h
View file @
da22ba7d
...
...
@@ -26,11 +26,12 @@
#include <stdint.h>
#include "mpegvideo.h"
#include "mpeg12.h"
void
ff_vdpau_add_data_chunk
(
MpegEncContext
*
s
,
const
uint8_t
*
buf
,
int
buf_size
);
void
ff_vdpau_mpeg_picture_complete
(
Mpeg
EncContext
*
s
,
const
uint8_t
*
buf
,
void
ff_vdpau_mpeg_picture_complete
(
Mpeg
1Context
*
s1
,
const
uint8_t
*
buf
,
int
buf_size
,
int
slice_count
);
void
ff_vdpau_h264_picture_start
(
MpegEncContext
*
s
);
...
...
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