todo.txt 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. - The code added to shorten frame gaps (to avoid allocating more than 16 new frames)
  23. appears to be wrong by inspection. It does not handle prev_frame_num > frame_num,
  24. and "h->frame_num - h->sps.ref_frame_count - 1" should be "h->frame_num - h->sps.ref_frame_count".
  25. mpeg4:
  26. - Packed B-frames need to be explicitly split up
  27. when frame threading is on. It's not very fast
  28. without this.
  29. - The buffer age optimization is disabled due to
  30. the way buffers are allocated across threads. The
  31. branch 'fix_buffer_age' has an attempt to fix it
  32. which breaks ffplay.
  33. - Support interlaced.
  34. mpeg1/2:
  35. - Seeking always prints "first frame not a keyframe"
  36. with threads on. Currently disabled for this reason.
  37. -- Prove correct
  38. - decode_update_progress() in h264.c
  39. race_checking branch has some work on h264,
  40. but not that function. It might be worth putting
  41. the branch under #ifdef DEBUG in mainline, but
  42. the code would have to be cleaner.
  43. - MPV_lowest_referenced_row() and co in mpegvideo.c
  44. - Same in vp3.
  45. -- Optimization
  46. - Merge h264 decode_update_progress() with loop_filter().
  47. Add CODEC_CAP_DRAW_HORIZ_BAND as a side effect.
  48. - EMU_EDGE is always set for h264 PAFF+MT
  49. because draw_edges() writes into the other field's
  50. thread's pixels. Needs an option to skip T/B fields.
  51. - Check update_thread_context() functions and make
  52. sure they only copy what they need to.
  53. - Try some more optimization of the "ref < 48; ref++"
  54. loop in h264.c await_references(), try turning the list0/list1 check
  55. above into a loop without being slower.
  56. - Support frame+slice threading at the same time
  57. by assigning slice_count threads for frame threads
  58. to use with execute(). This is simpler but unbalanced
  59. if only one frame thread uses any.
  60. -- Features
  61. - Support streams with width/height changing. This
  62. requires flushing all current frames (and buffering
  63. the input in the meantime), closing the codec and
  64. reopening it. Or don't support it.
  65. - Support encoding. Might need more threading primitives
  66. for good ratecontrol; would be nice for audio and libavfilter too.
  67. - Async decoding part 1: instead of trying to
  68. start every thread at the beginning, return a picture
  69. if the earliest thread is already done, but don't wait
  70. for it. Not sure what effect this would have.
  71. - Part 2: have an API that doesn't wait for the decoding
  72. thread, only returns EAGAIN if it's not ready. What will
  73. it do with the next input packet if it returns that?
  74. - Have an API that returns finished pictures but doesn't
  75. require sending new ones. Maybe allow NULL avpkt when
  76. not at the end of the stream.
  77. -- Samples
  78. http://astrange.ithinksw.net/ffmpeg/mt-samples/
  79. See yuvcmp.c in this directory to compare decoded samples.
  80. For debugging, try commenting out ff_thread_finish_setup calls so
  81. that only one thread runs at once, and then binary search+
  82. scatter printfs to look for differences in codec contexts.