[prev in list] [next in list] [prev in thread] [next in thread]
List: dirac-commits
Subject: [Dirac-commits] compress/libdirac_common band_codec.cpp, 1.42,
From: Anuradha Suraparaju <asuraparaju () users ! sourceforge ! net>
Date: 2008-08-20 12:03:30
Message-ID: E1KVmPT-0004Ix-En () mail ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/dirac/compress/libdirac_common
In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv2787/libdirac_common
Modified Files:
band_codec.cpp band_codec.h band_vlc.cpp band_vlc.h
Log Message:
Fix bug in handling skipped code blocks in DC bands when decoding. Also fix
bug in calculating the quantiser index in multiple quantiser mode for DC
sub-bands in Intra pictures.
Author: asuraparaju@diracvideo.org <anuradha@hoyle.dp.rd.bbc.co.uk>
Index: band_vlc.cpp
===================================================================
RCS file: /cvsroot/dirac/compress/libdirac_common/band_vlc.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** band_vlc.cpp 29 Apr 2008 08:51:52 -0000 1.4
--- band_vlc.cpp 20 Aug 2008 12:03:28 -0000 1.5
***************
*** 344,347 ****
--- 344,351 ----
const TwoDArray<CodeBlock>& block_list( m_node.GetCodeBlocks() );
+ // coeff blocks can be skipped only if SpatialPartitioning is
+ // enabled i.e. more than one code-block per subband
+ bool decode_skip= (block_list.LengthX() > 1 || block_list.LengthY() > 1);
+
// Now loop over the blocks and decode
for (int j=block_list.FirstY() ; j<=block_list.LastY() ; ++j)
***************
*** 349,353 ****
for (int i=block_list.FirstX() ; i<=block_list.LastX() ; ++i)
{
! DecodeCoeffBlock( block_list[j][i] , out_data );
}// i
}// j
--- 353,365 ----
for (int i=block_list.FirstX() ; i<=block_list.LastX() ; ++i)
{
! if (decode_skip)
! block_list[j][i].SetSkip( m_byteio->ReadBoolB() );
!
! if ( !block_list[j][i].Skipped() )
! DecodeCoeffBlock( block_list[j][i] , out_data );
! else
! ClearBlock( block_list[j][i] , out_data);
!
! DCPrediction( block_list[j][i], out_data);
}// i
}// j
***************
*** 380,383 ****
--- 392,410 ----
{
DecodeVal( out_data , xpos , ypos );
+ }//xpos
+ }//ypos
+ }
+
+ void IntraDCBandVLC::DCPrediction( const CodeBlock& code_block , CoeffArray& \
out_data) + {
+ const int xbeg = code_block.Xstart();
+ const int ybeg = code_block.Ystart();
+ const int xend = code_block.Xend();
+ const int yend = code_block.Yend();
+
+ for ( int ypos=ybeg ; ypos<yend ; ++ypos)
+ {
+ for ( int xpos=xbeg ; xpos<xend ; ++xpos)
+ {
out_data[ypos][xpos] += GetPrediction( out_data , xpos , ypos );
}//xpos
Index: band_codec.h
===================================================================
RCS file: /cvsroot/dirac/compress/libdirac_common/band_codec.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** band_codec.h 29 Apr 2008 08:51:52 -0000 1.28
--- band_codec.h 20 Aug 2008 12:03:28 -0000 1.29
***************
*** 231,234 ****
--- 231,235 ----
void CodeCoeffBlock(const CodeBlock& code_block , CoeffArray& in_data);
void DecodeCoeffBlock(const CodeBlock& code_block , CoeffArray& out_data);
+ void DCPrediction(const CodeBlock& code_block , CoeffArray& out_data);
//! Private, bodyless copy constructor: class should not be copied
Index: band_vlc.h
===================================================================
RCS file: /cvsroot/dirac/compress/libdirac_common/band_vlc.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** band_vlc.h 29 Apr 2008 08:51:52 -0000 1.4
--- band_vlc.h 20 Aug 2008 12:03:28 -0000 1.5
***************
*** 168,171 ****
--- 168,172 ----
void CodeCoeffBlock(const CodeBlock& code_block , CoeffArray& in_data);
void DecodeCoeffBlock(const CodeBlock& code_block , CoeffArray& out_data);
+ void DCPrediction(const CodeBlock& code_block , CoeffArray& out_data);
//! Private, bodyless copy constructor: class should not be copied
Index: band_codec.cpp
===================================================================
RCS file: /cvsroot/dirac/compress/libdirac_common/band_codec.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** band_codec.cpp 29 Apr 2008 08:51:52 -0000 1.42
--- band_codec.cpp 20 Aug 2008 12:03:28 -0000 1.43
***************
*** 627,631 ****
if ( m_node.UsingMultiQuants() )
{
! qf_idx += m_last_qf_idx+DecodeQuantIndexOffset();
m_last_qf_idx = qf_idx;
}
--- 627,631 ----
if ( m_node.UsingMultiQuants() )
{
! qf_idx = m_last_qf_idx+DecodeQuantIndexOffset();
m_last_qf_idx = qf_idx;
}
***************
*** 753,761 ****
// Now loop over the blocks and decode
for (int j=block_list.FirstY() ; j<=block_list.LastY() ; ++j)
{
for (int i=block_list.FirstX() ; i<=block_list.LastX() ; ++i)
{
! DecodeCoeffBlock( block_list[j][i] , out_data );
}// i
}// j
--- 753,773 ----
// Now loop over the blocks and decode
+ bool decode_skip= (block_list.LengthX() > 1 || block_list.LengthY() > 1);
for (int j=block_list.FirstY() ; j<=block_list.LastY() ; ++j)
{
for (int i=block_list.FirstX() ; i<=block_list.LastX() ; ++i)
{
! if (decode_skip)
! block_list[j][i].SetSkip( DecodeSymbol( BLOCK_SKIP_CTX ) );
! if ( !block_list[j][i].Skipped() )
! {
! DecodeCoeffBlock( block_list[j][i] , out_data );
! }
! else
! {
! ClearBlock (block_list[j][i] , out_data);
! ClearBlock (block_list[j][i] , m_dc_pred_res);
! }
! DCPrediction (block_list[j][i] , out_data);
}// i
}// j
***************
*** 799,808 ****
DecodeVal( out_data , xpos , ypos );
m_dc_pred_res[ypos][xpos] = out_data[ypos][xpos];
- out_data[ypos][xpos] += GetPrediction( out_data , xpos , ypos );
-
}//xpos
}//ypos
}
CoeffType IntraDCBandCodec::GetPrediction( const CoeffArray& data , const int xpos \
, const int ypos ) const
--- 811,833 ----
DecodeVal( out_data , xpos , ypos );
m_dc_pred_res[ypos][xpos] = out_data[ypos][xpos];
}//xpos
}//ypos
}
+ void IntraDCBandCodec::DCPrediction(const CodeBlock& code_block , CoeffArray& \
out_data) + {
+ const int xbeg = code_block.Xstart();
+ const int ybeg = code_block.Ystart();
+ const int xend = code_block.Xend();
+ const int yend = code_block.Yend();
+
+ for ( int ypos=ybeg ; ypos<yend ; ++ypos)
+ {
+ for ( int xpos=xbeg ; xpos<xend ; ++xpos)
+ {
+ out_data[ypos][xpos] += GetPrediction( out_data , xpos , ypos );
+ }
+ }
+ }
CoeffType IntraDCBandCodec::GetPrediction( const CoeffArray& data , const int xpos \
, const int ypos ) const
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Dirac-commits mailing list
Dirac-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dirac-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic