todo.txt 3.4 KB

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