Dirac - A Video Codec

Created by the British Broadcasting Corporation.


seq_compress.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2 *
3 * $Id: seq_compress.h,v 1.33 2008/10/20 04:20:12 asuraparaju Exp $ $Name: Dirac_1_0_2 $
4 *
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 *
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.1 (the "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14 * the specific language governing rights and limitations under the License.
15 *
16 * The Original Code is BBC Research and Development code.
17 *
18 * The Initial Developer of the Original Code is the British Broadcasting
19 * Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 2004.
21 * All Rights Reserved.
22 *
23 * Contributor(s): Thomas Davies (Original Author),
24 * Scott R Ladd,
25 * Anuradha Suraparaju
26 * Andrew Kennedy
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
30 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
31 * the GPL or the LGPL are applicable instead of those above. If you wish to
32 * allow use of your version of this file only under the terms of the either
33 * the GPL or LGPL and not to allow others to use your version of this file
34 * under the MPL, indicate your decision by deleting the provisions above
35 * and replace them with the notice and other provisions required by the GPL
36 * or LGPL. If you do not delete the provisions above, a recipient may use
37 * your version of this file under the terms of any one of the MPL, the GPL
38 * or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
40 
41 #ifndef _SEQ_COMPRESS_H_
42 #define _SEQ_COMPRESS_H_
43 
45 //-------------------------------------//
46 //Class to manage compressing sequences//
47 //-------------------------------------//
49 
51 #include <libdirac_common/common.h>
53 #include <libdirac_common/pic_io.h>
58 
59 #include <fstream>
60 
61 namespace dirac
62 {
63 
65 
74  public:
76 
85  EncoderParams& encp,
86  DiracByteStream& dirac_byte_stream);
87 
89 
92  virtual ~SequenceCompressor();
93 
95 
103  virtual bool LoadNextFrame() = 0;
104 
106 
126 
128  virtual void SetPicTypeAndRefs( PictureParams& pparams ) = 0;
129 
131  const EncPicture *GetPictureEncoded();
132 
134 
136 
141  bool Finished(){return m_all_done;}
142 
144  void SignalEOS() { m_eos_signalled = true; }
145 
147  int PTSOffset(){return m_delay;}
148 
149  protected:
150 
152  void SetMotionParameters();
153 
155 
161  virtual int CodedToDisplay(const int pnum) = 0;
162 
164  void MakeSequenceReport();
165 
167  virtual void CleanBuffers();
168 
170  //Purely virtual. The child class will have to define it.
171  virtual void UpdateCBRModel(EncPicture& my_picture, const PictureByteIO* picture_byteio) = 0;
172 
174  void UpdateIntraPicCBRModel( const PictureParams& , const bool is_a_cut );
175 
177  bool CanEncode();
178 
181 
183 
189 
192 
195 
198 
201 
204 
207 
210 
212  int m_L1_sep;
213 
216 
219 
222 
223  //state variables for CompressNextPicture
224 
227 
230 
233 
236 
239 
241  int m_delay;
242 
245 
248 
251 
254 
257 
258  private:
260 
265 
267 
272 
273 
274  };
275 
277 
284  {
285  public:
287 
297  EncoderParams& encp,
298  DiracByteStream& dirac_byte_stream);
299 
301 
305 
307 
313  virtual bool LoadNextFrame();
314 
316  virtual void SetPicTypeAndRefs( PictureParams& pparams );
317 
318 protected:
319  virtual int CodedToDisplay(const int pnum);
320  virtual void UpdateCBRModel(EncPicture& my_picture, const PictureByteIO* picture_byteio);
321 
322  };
323 
325 
332  {
333  public:
335 
344  EncoderParams& encp,
345  DiracByteStream& dirac_byte_stream);
346 
348 
351  virtual ~FieldSequenceCompressor();
352 
354 
361  virtual bool LoadNextFrame();
362 
363 
365  virtual void SetPicTypeAndRefs( PictureParams& pparams );
366 
367  protected:
368 
369  virtual int CodedToDisplay(const int pnum);
370 
371  virtual void UpdateCBRModel(EncPicture& my_picture, const PictureByteIO* picture_byteio);
372  private:
374 
378  void PreMotionEstmationFilter (PicArray& comp);
379 
380  // Field1 bytes
382  // Field2 bytes
384  };
385 } // namespace dirac
386 
387 #endif

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.