]> git.sesse.net Git - ffmpeg/blob - mt-work/todo.txt
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / mt-work / todo.txt
1 Todo
2
3 -- For other people
4 - Multithread vc1.
5 - Multithread an intra codec like mjpeg (trivial).
6 - Fix mpeg1 (see below).
7 - Try the first three items under Optimization.
8 - Fix h264 (see below).
9 - Try mpeg4 (see below).
10
11 -- Bug fixes
12
13 General critical:
14 - Error resilience has to run before ff_report_frame_progress()
15 is called. Otherwise there will be race conditions. (This might already
16 work.) In general testing error paths should be done more.
17 - 'make fate THREADS=2' doesn't pass. Most failures are due to
18 bugs in vsync in ffmpeg.c, which are currently obscuring real failures.
19
20 h264:
21 - Files that aren't parsed (e.g. mp4) and contain PAFF with two
22 field pictures in the same packet are not optimal. Modify the
23 nals_needed check so that the second field's first slice is
24 considered as needed, then uncomment the FIXME code in decode_postinit.
25 Ex: http://astrange.ithinksw.net/ffmpeg/mt-samples/PAFF-Chalet-Tire.mp4
26
27 mpeg4:
28 - Packed B-frames need to be explicitly split up
29 when frame threading is on. It's not very fast
30 without this.
31 - The buffer age optimization is disabled due to
32 the way buffers are allocated across threads. The
33 branch 'fix_buffer_age' has an attempt to fix it
34 which breaks ffplay.
35 - Support interlaced.
36
37 mpeg1/2:
38 - Seeking always prints "first frame not a keyframe"
39 with threads on. Currently disabled for this reason.
40
41 -- Prove correct
42
43 - decode_update_progress() in h264.c
44 race_checking branch has some work on h264,
45 but not that function. It might be worth putting
46 the branch under #ifdef DEBUG in mainline, but
47 the code would have to be cleaner.
48 - MPV_lowest_referenced_row() and co in mpegvideo.c
49 - Same in vp3.
50
51 -- Optimization
52
53 - Merge h264 decode_update_progress() with loop_filter().
54 Add CODEC_CAP_DRAW_HORIZ_BAND as a side effect.
55 - EMU_EDGE is always set for h264 PAFF+MT
56 because draw_edges() writes into the other field's
57 thread's pixels. Needs an option to skip T/B fields.
58 - Check update_thread_context() functions and make
59 sure they only copy what they need to.
60 - Try some more optimization of the "ref < 48; ref++"
61 loop in h264.c await_references(), try turning the list0/list1 check
62 above into a loop without being slower.
63 - Support frame+slice threading at the same time
64 by assigning slice_count threads for frame threads
65 to use with execute(). This is simpler but unbalanced
66 if only one frame thread uses any.
67
68 -- Features
69
70 - Support streams with width/height changing. This
71 requires flushing all current frames (and buffering
72 the input in the meantime), closing the codec and
73 reopening it. Or don't support it.
74 - Support encoding. Might need more threading primitives
75 for good ratecontrol; would be nice for audio and libavfilter too.
76 - Async decoding part 1: instead of trying to
77 start every thread at the beginning, return a picture
78 if the earliest thread is already done, but don't wait
79 for it. Not sure what effect this would have.
80 - Part 2: have an API that doesn't wait for the decoding
81 thread, only returns EAGAIN if it's not ready. What will
82 it do with the next input packet if it returns that?
83 - Have an API that returns finished pictures but doesn't
84 require sending new ones. Maybe allow NULL avpkt when
85 not at the end of the stream.
86
87 -- Samples
88
89 http://astrange.ithinksw.net/ffmpeg/mt-samples/
90
91 See yuvcmp.c in this directory to compare decoded samples.
92
93 For debugging, try commenting out ff_thread_finish_setup calls so
94 that only one thread runs at once, and then binary search+
95 scatter printfs to look for differences in codec contexts.