~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/mpegplay/macroBlock.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  stores macroblock infos
 
3
  Copyright (C) 2000  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
#ifndef __MACROBLOCK_H
 
16
#define __MACROBLOCK_H
 
17
 
 
18
#include "videoDecoder.h"
 
19
#include "decoderClass.h"
 
20
#include "motionVector.h"
 
21
#include "recon.h"
 
22
#include "copyFunctions.h"
 
23
 
 
24
class MacroBlock {
 
25
  
 
26
  /* Macroblock structure. */
 
27
 
 
28
  int mb_address;                        /* Macroblock address.              */
 
29
  int past_mb_addr;                      /* Previous mblock address.         */
 
30
  int motion_h_forw_code;                /* Forw. horiz. motion vector code. */
 
31
  unsigned int motion_h_forw_r;          /* Used in decoding vectors.        */
 
32
  int motion_v_forw_code;                /* Forw. vert. motion vector code.  */
 
33
  unsigned int motion_v_forw_r;          /* Used in decdoinge vectors.       */
 
34
  int motion_h_back_code;                /* Back horiz. motion vector code.  */
 
35
  unsigned int motion_h_back_r;          /* Used in decoding vectors.        */
 
36
  int motion_v_back_code;                /* Back vert. motion vector code.   */
 
37
  unsigned int motion_v_back_r;          /* Used in decoding vectors.        */
 
38
  unsigned int cbp;                      /* Coded block pattern.             */
 
39
  int mb_intra;                          /* Intracoded mblock flag.          */
 
40
  int bpict_past_forw;                   /* Past B frame forw. vector flag.  */
 
41
  int bpict_past_back;                   /* Past B frame back vector flag.   */
 
42
  int past_intra_addr;                   /* Addr of last intracoded mblock.  */
 
43
  int recon_right_for_prev;              /* Past right forw. vector.         */
 
44
  int recon_down_for_prev;               /* Past down forw. vector.          */
 
45
  int recon_right_back_prev;             /* Past right back vector.          */
 
46
  int recon_down_back_prev;              /* Past down back vector.           */
 
47
 
 
48
  class VideoDecoder* vid_stream;
 
49
  CopyFunctions* copyFunctions;
 
50
 
 
51
 public:
 
52
  MacroBlock(class VideoDecoder* vid_stream);
 
53
  ~MacroBlock();
 
54
  int processMacroBlock(PictureArray* pictureArray);
 
55
  int resetMacroBlock();
 
56
  int resetPastMacroBlock();
 
57
 
 
58
 private:
 
59
  int reconstruct(int& recon_right_for,
 
60
                  int& recon_down_for,
 
61
                  int& recon_right_back,
 
62
                  int& recon_down_back,
 
63
                  int& mb_motion_forw,
 
64
                  int& mb_motion_back,
 
65
                  PictureArray* pictureArray);
 
66
 
 
67
  void computeForwVector(int* recon_right_for_ptr,
 
68
                         int* recon_down_for_ptr);
 
69
 
 
70
  void computeBackVector(int* recon_right_back_ptr,
 
71
                         int* recon_down_back_ptr);
 
72
 
 
73
  int processSkippedPictures(PictureArray* pictureArray,
 
74
                             int code_type,
 
75
                             int mb_width);
 
76
 
 
77
  void ProcessSkippedPFrameMBlocks(YUVPicture* current,
 
78
                                   YUVPicture* future,
 
79
                                   int mb_width);
 
80
  
 
81
 
 
82
  void ProcessSkippedBFrameMBlocks(Picture* picture,
 
83
                                   YUVPicture* past,
 
84
                                   YUVPicture* current,
 
85
                                   YUVPicture* future,
 
86
                                   int mb_width);
 
87
 
 
88
 
 
89
  void ReconSkippedBlock(unsigned char* source,unsigned char* dest,
 
90
                         int row, int col,int row_size,
 
91
                         int right,int down,
 
92
                         int right_half,int down_half,int width,
 
93
                         int maxLen);
 
94
  
 
95
    
 
96
};
 
97
#endif