You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/speedhqenc: Inline ff_speedhq_mb_y_order_to_mb()
It is an extremely simple function that is only called once, so it should be inlined. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -272,22 +272,6 @@ void ff_speedhq_encode_mb(MpegEncContext *s, int16_t block[12][64])
|
||||
s->i_tex_bits += get_bits_diff(s);
|
||||
}
|
||||
|
||||
static int ff_speedhq_mb_rows_in_slice(int slice_num, int mb_height)
|
||||
{
|
||||
return mb_height / 4 + (slice_num < (mb_height % 4));
|
||||
}
|
||||
|
||||
int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_slice)
|
||||
{
|
||||
int slice_num = 0;
|
||||
while (mb_y_order >= ff_speedhq_mb_rows_in_slice(slice_num, mb_height)) {
|
||||
mb_y_order -= ff_speedhq_mb_rows_in_slice(slice_num, mb_height);
|
||||
slice_num++;
|
||||
}
|
||||
*first_in_slice = (mb_y_order == 0);
|
||||
return mb_y_order * 4 + slice_num;
|
||||
}
|
||||
|
||||
const FFCodec ff_speedhq_encoder = {
|
||||
.p.name = "speedhq",
|
||||
CODEC_LONG_NAME("NewTek SpeedHQ"),
|
||||
|
@ -40,6 +40,20 @@ void ff_speedhq_encode_mb(MpegEncContext *s, int16_t block[12][64]);
|
||||
void ff_speedhq_encode_picture_header(MpegEncContext *s);
|
||||
void ff_speedhq_end_slice(MpegEncContext *s);
|
||||
|
||||
int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_slice);
|
||||
static inline int ff_speedhq_mb_rows_in_slice(int slice_num, int mb_height)
|
||||
{
|
||||
return mb_height / 4 + (slice_num < (mb_height % 4));
|
||||
}
|
||||
|
||||
static inline int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_slice)
|
||||
{
|
||||
int slice_num = 0;
|
||||
while (mb_y_order >= ff_speedhq_mb_rows_in_slice(slice_num, mb_height)) {
|
||||
mb_y_order -= ff_speedhq_mb_rows_in_slice(slice_num, mb_height);
|
||||
slice_num++;
|
||||
}
|
||||
*first_in_slice = (mb_y_order == 0);
|
||||
return mb_y_order * 4 + slice_num;
|
||||
}
|
||||
|
||||
#endif /* AVCODEC_SPEEDHQENC_H */
|
||||
|
Reference in New Issue
Block a user