History

Introduce slice threads flag.

Ronald S. Bultje committed 15 years ago

Commit 94f74511 parent 3283f2712 files · +23 −10Browse files

Unified · Split

12 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +4 −0
  3. libavcodec/dnxhdenc.c +1 −0
  4. libavcodec/dv.c +2 −1
  5. libavcodec/ffv1.c +2 −1
  6. libavcodec/h264.c +2 −1
  7. libavcodec/mpeg12.c +2 −2
  8. libavcodec/mpeg12enc.c +2 −2
  9. libavcodec/mpeg4videoenc.c +1 −1
  10. libavcodec/mpegvideo_enc.c +1 −0
  11. libavcodec/pthread.c +2 −1
  12. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2011-04-18 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2011-04-21 - XXXXXX - lavc 53.1.0 - avcodec.h
17+ Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
18+
1619 2011-04-15 - lavc 52.120.0 - avcodec.h
1720 AVPacket structure got additional members for passing side information:
1821 4de339e introduce side information for AVPacket
libavcodec/avcodec.h+4−0
@@ -676,6 +676,10 @@ typedef struct RcOverride{ · 675 unmodified lines
676676 * Codec supports frame-level multithreading.
677677 */
678678 #define CODEC_CAP_FRAME_THREADS 0x1000
679+/**
680+ * Codec supports slice-based (or partition-based) multithreading.
681+ */
682+#define CODEC_CAP_SLICE_THREADS 0x2000
679683
680684 //The following defines may change, don't expect compatibility if you use them.
681685 #define MB_TYPE_INTRA4x4 0x0001
libavcodec/dnxhdenc.c+1−0
@@ -869,6 +869,7 @@ AVCodec ff_dnxhd_encoder = { · 868 unmodified lines
869869 dnxhd_encode_init,
870870 dnxhd_encode_picture,
871871 dnxhd_encode_end,
872+ .capabilities = CODEC_CAP_SLICE_THREADS,
872873 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P, PIX_FMT_NONE},
873874 .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
874875 .priv_class = &class,
libavcodec/dv.c+2−1
@@ -1297,6 +1297,7 @@ AVCodec ff_dvvideo_encoder = { · 1296 unmodified lines
12971297 sizeof(DVVideoContext),
12981298 dvvideo_init_encoder,
12991299 dvvideo_encode_frame,
1300+ .capabilities = CODEC_CAP_SLICE_THREADS,
13001301 .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE},
13011302 .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
13021303 };
@@ -1312,7 +1313,7 @@ AVCodec ff_dvvideo_decoder = { · 9 unmodified lines
13121313 NULL,
13131314 dvvideo_close,
13141315 dvvideo_decode_frame,
1315− CODEC_CAP_DR1,
1316+ CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
13161317 NULL,
13171318 .max_lowres = 3,
13181319 .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
libavcodec/ffv1.c+2−1
@@ -1795,7 +1795,7 @@ AVCodec ff_ffv1_decoder = { · 1794 unmodified lines
17951795 NULL,
17961796 common_end,
17971797 decode_frame,
1798− CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
1798+ CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/ | CODEC_CAP_SLICE_THREADS,
17991799 NULL,
18001800 .long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
18011801 };
@@ -1809,6 +1809,7 @@ AVCodec ff_ffv1_encoder = { · 7 unmodified lines
18091809 encode_init,
18101810 encode_frame,
18111811 common_end,
1812+ .capabilities = CODEC_CAP_SLICE_THREADS,
18121813 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_NONE},
18131814 .long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
18141815 };
libavcodec/h264.c+2−1
@@ -3426,7 +3426,8 @@ AVCodec ff_h264_decoder = { · 3425 unmodified lines
34263426 NULL,
34273427 ff_h264_decode_end,
34283428 decode_frame,
3429− /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY,
3429+ /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY |
3430+ CODEC_CAP_SLICE_THREADS,
34303431 .flush= flush_dpb,
34313432 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
34323433 .profiles = NULL_IF_CONFIG_SMALL(profiles),
libavcodec/mpeg12.c+2−2
@@ -2523,7 +2523,7 @@ AVCodec ff_mpeg2video_decoder = { · 2522 unmodified lines
25232523 NULL,
25242524 mpeg_decode_end,
25252525 mpeg_decode_frame,
2526− CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
2526+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
25272527 .flush= flush,
25282528 .max_lowres= 3,
25292529 .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
@@ -2540,7 +2540,7 @@ AVCodec ff_mpegvideo_decoder = { · 10 unmodified lines
25402540 NULL,
25412541 mpeg_decode_end,
25422542 mpeg_decode_frame,
2543− CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
2543+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
25442544 .flush= flush,
25452545 .max_lowres= 3,
25462546 .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
libavcodec/mpeg12enc.c+2−2
@@ -940,7 +940,7 @@ AVCodec ff_mpeg1video_encoder = { · 939 unmodified lines
940940 MPV_encode_end,
941941 .supported_framerates= ff_frame_rate_tab+1,
942942 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
943− .capabilities= CODEC_CAP_DELAY,
943+ .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
944944 .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
945945 };
946946
@@ -954,6 +954,6 @@ AVCodec ff_mpeg2video_encoder = { · 7 unmodified lines
954954 MPV_encode_end,
955955 .supported_framerates= ff_frame_rate_tab+1,
956956 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE},
957− .capabilities= CODEC_CAP_DELAY,
957+ .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
958958 .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
959959 };
libavcodec/mpeg4videoenc.c+1−1
@@ -1347,6 +1347,6 @@ AVCodec ff_mpeg4_encoder = { · 1346 unmodified lines
13471347 MPV_encode_picture,
13481348 MPV_encode_end,
13491349 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
1350− .capabilities= CODEC_CAP_DELAY,
1350+ .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
13511351 .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
13521352 };
libavcodec/mpegvideo_enc.c+1−0
@@ -3800,6 +3800,7 @@ AVCodec ff_h263p_encoder = { · 3799 unmodified lines
38003800 MPV_encode_init,
38013801 MPV_encode_picture,
38023802 MPV_encode_end,
3803+ .capabilities = CODEC_CAP_SLICE_THREADS,
38033804 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
38043805 .long_name= NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
38053806 };
libavcodec/pthread.c+2−1
@@ -877,7 +877,8 @@ static void validate_thread_parameters(AVCodecContext *avctx) · 876 unmodified lines
877877 avctx->active_thread_type = 0;
878878 } else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
879879 avctx->active_thread_type = FF_THREAD_FRAME;
880− } else if (avctx->thread_type & FF_THREAD_SLICE) {
880+ } else if (avctx->codec->capabilities & CODEC_CAP_SLICE_THREADS &&
881+ avctx->thread_type & FF_THREAD_SLICE) {
881882 avctx->active_thread_type = FF_THREAD_SLICE;
882883 }
883884 }
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AVCODEC_VERSION_H
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 53
24−#define LIBAVCODEC_VERSION_MINOR 0
24+#define LIBAVCODEC_VERSION_MINOR 1
2525 #define LIBAVCODEC_VERSION_MICRO 0
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t