MPlayer 00067 * can only handle a 20 picture delay (although this is arbitrary, and needs 00068 * to be extended to fully support the CrystalHD where the delay could be up 00069 * to 32 pictures - consider PAFF H.264 content with 16 b-frames). 00062 * 00063 * Finally, to be explicit, we do not want the pipeline to grow without bound 00064 * for two reasons: 1) The hardware can only buffer a finite number of packets, 00065 * and 2) The client application may not be able to cope with arbitrarily long 00066 * delays in the video path relative to the audio path. This in turn, 00056 * means we have to be sensitive to the time it takes to decode a picture 00057 * We do not want to give up just because the hardware needed a little more 00058 * time to prepare the picture! For this reason, there are delays included 00059 * in the decode() path that ensure that, under normal conditions, the hardware 00060 * will only fail to return a frame if it really needs additional packets to 00061 * complete the decoding. 00053 * 00054 * As such, the code will return in the event that a picture cannot be copied 00055 * out, leading to an increase in the length of the pipeline. If that happened, you could 00051 * deadlock trying to retrieve a frame that can't be decoded without feeding 00052 * in additional packets. 00045 * 00046 * Finally, while it is tempting to say that once the decoder starts outputting 00047 * frames, the software should never fail to return a frame from a decode(), 00048 * this is a hard assertion to make, because the stream may switch between 00049 * differently encoded content (number of b-frames, interlacing, etc) which 00050 * might require a longer pipeline than before. 00040 * 00041 * The hardware has a way of indicating that a picture is ready to be copied out, 00042 * but this is unreliable - and sometimes the attempt will still fail so, based 00043 * on testing, the code will wait until 3 pictures are ready before starting 00044 * to copy out - and this has the effect of extending the pipeline. If that was all it took, things would still 00039 * be simple - so, of course, it isn't. 00036 * 00037 * As such, a pipeline will build up that is roughly equivalent to the required 00038 * DPB for the file being played. Furthermore, this delay 00034 * is not just a function of time, but also one of the dependency on additional 00035 * frames being fed into the decoder to satisfy the b-frame dependencies. Due, at the very least, to b-frame 00032 * dependencies in the supported formats, the hardware has a delay between 00033 * when a packet goes in, and when a picture comes out. 00030 * 00031 * Of course, nothing is ever that simple. You feed demuxed 00029 * packets in one end and get decoded picture (fields/frames) out the other. 00028 * This means it has a very simple interface, in principle. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with FFmpeg if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-131 */ 00022Ġ0023 /* 00024 * - Principles of Operation - 00025 * 00026 * The CrystalHD decoder operates at the bitstream level - which is an even 00027 * higher level than the decoding hardware you typically see in modern GPUs. See the GNU 00016 * Lesser General Public License for more details. 00012 * 00013 * FFmpeg is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00007 * 00008 * FFmpeg is free software you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation either 00011 * version 2.1 of the License, or (at your option) any later version.
0 Comments
Leave a Reply. |