Update of /cvsroot/dirac/compress/util/instrumentation
In directory
sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv30631/util/instrum
entation
Modified Files:
instrmain.cpp process_sequence.cpp
Log Message:
Added support for interlaced coding. Changes include
refactoring of PicIO
classes, SequenceCompressor class to handle interlaced
coding. Modified GOP
structure for interlaced coding to code interlaced material
more efficiently.
Index: process_sequence.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/util/instrumentation/process_sequenc
e.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** process_sequence.cpp 3 Sep 2007 11:31:43 -0000 1.9
--- process_sequence.cpp 26 Sep 2007 12:18:43 -0000 1.10
***************
*** 42,49 ****
using namespace dirac;
! ProcessSequence::ProcessSequence(OverlayParams &
oparams,
FileStreamInput &
inputpic,
FileStreamOutput &
outputpic,
! std::ifstream & in,
bool verbose,
int buffer, SourceParams
& srcparams) :
m_oparams(oparams),
--- 42,49 ----
using namespace dirac;
! ProcessSequence::ProcessSequence(OverlayParams &
oparams,
FileStreamInput &
inputpic,
FileStreamOutput &
outputpic,
! std::ifstream & in,
bool verbose,
int buffer, SourceParams
& srcparams) :
m_oparams(oparams),
***************
*** 69,73 ****
// read next frame from input sequence
Frame * frame = new
Frame(m_data_array[index].frame_params);
! m_inputpic.ReadNextFrame(*frame);
Overlay overlay(m_oparams, *frame);
--- 69,73 ----
// read next frame from input sequence
Frame * frame = new
Frame(m_data_array[index].frame_params);
!
m_inputpic.GetStream()->ReadNextPicture(*frame);
Overlay overlay(m_oparams, *frame);
***************
*** 93,97 ****
// write the frame to the output file
! m_outputpic.WriteNextFrame(*frame);
// de-allocate memory for frame
--- 93,97 ----
// write the frame to the output file
!
m_outputpic.GetStream()->WriteNextFrame(*frame);
// de-allocate memory for frame
***************
*** 141,145 ****
std::cout << m_data_fnum << "
data";
}
!
int mb_xnum = 0, mb_ynum = 0, mv_xnum = 0, mv_ynum
= 0;
int total_refs = 0;
--- 141,145 ----
std::cout << m_data_fnum << "
data";
}
!
int mb_xnum = 0, mb_ynum = 0, mv_xnum = 0, mv_ynum
= 0;
int total_refs = 0;
***************
*** 154,158 ****
// clear reference vector
m_data_array[new_index].frame_params.Refs().clear();
!
for (int i=0; i<total_refs; ++i)
{
--- 154,158 ----
// clear reference vector
m_data_array[new_index].frame_params.Refs().clear();
!
for (int i=0; i<total_refs; ++i)
{
***************
*** 185,190 ****
// read motion vector data
! m_data_in >>
*m_data_array[new_index].me_data; // overloaded
operator>> defined in libdirac_common/motion.cpp
!
if (m_verbose)
{
--- 185,190 ----
// read motion vector data
! m_data_in >>
*m_data_array[new_index].me_data; // overloaded
operator>> defined in libdirac_common/motion.cpp
!
if (m_verbose)
{
***************
*** 215,219 ****
FrameParams
fparams(m_inputpic.GetSourceParams());
Frame * frame = new Frame(fparams);
! m_inputpic.ReadNextFrame(*frame);
delete frame;
}
--- 215,219 ----
FrameParams
fparams(m_inputpic.GetSourceParams());
Frame * frame = new Frame(fparams);
!
m_inputpic.GetStream()->ReadNextPicture(*frame);
delete frame;
}
***************
*** 279,283 ****
AddFrameEntry();
}
!
} while (m_data_fnum == data_next_fnum
&& !m_data_in.eof());
--- 279,283 ----
AddFrameEntry();
}
!
} while (m_data_fnum == data_next_fnum
&& !m_data_in.eof());
***************
*** 306,309 ****
// close motion data file
m_data_in.close();
! }
--- 306,309 ----
// close motion data file
m_data_in.close();
! }
Index: instrmain.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/util/instrumentation/instrmain.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** instrmain.cpp 3 Sep 2007 11:31:43 -0000 1.10
--- instrmain.cpp 26 Sep 2007 12:18:43 -0000 1.11
***************
*** 60,64 ****
cout << "noutput string I
[ required ] Output file name";
cout << "n";
! cout << "nmotion_colour bool I
true Display motion vectors using colour
wheel";
cout << "nmotion_arrows bool I
false Display motion vectors as arrows";
cout << "nmotion_colour_arrows bool I
false Display motion vectors as arrows with colour
size";
--- 60,64 ----
cout << "noutput string I
[ required ] Output file name";
cout << "n";
! cout << "nmotion_colour bool I
true Display motion vectors using colour
wheel";
cout << "nmotion_arrows bool I
false Display motion vectors as arrows";
cout << "nmotion_colour_arrows bool I
false Display motion vectors as arrows with colour
size";
***************
*** 72,76 ****
cout << "n";
cout << "nglobal bool I
false Display global motion";
! cout << "nglobal_diff bool I
false Display global motion error";
cout << "nclip int I
25 / 10000 Clip for max value motion vector / SAD
overlays";
cout << "nref int I
1 Reference frame";
--- 72,76 ----
cout << "n";
cout << "nglobal bool I
false Display global motion";
! cout << "nglobal_diff bool I
false Display global motion error";
cout << "nclip int I
25 / 10000 Clip for max value motion vector / SAD
overlays";
cout << "nref int I
1 Reference frame";
***************
*** 95,99 ****
in >> temp_int;
srcparams.SetXl( temp_int );
!
in >> temp_int;
srcparams.SetYl( temp_int );
--- 95,99 ----
in >> temp_int;
srcparams.SetXl( temp_int );
!
in >> temp_int;
srcparams.SetYl( temp_int );
***************
*** 106,111 ****
int num, denom;
! in >> num;
! in >> denom;
srcparams.SetFrameRate( num, denom );
--- 106,111 ----
int num, denom;
! in >> num;
! in >> denom;
srcparams.SetFrameRate( num, denom );
***************
*** 139,155 ****
bool_opts.insert("motion_colour");
bool_opts.insert("motion_arrows");
! bool_opts.insert("motion_colour_arrows");
bool_opts.insert("split_mode");
bool_opts.insert("sad");
! bool_opts.insert("pred_mode");
bool_opts.insert("global");
bool_opts.insert("global_diff");
bool_opts.insert("global_inliers");
!
// parse command line options
CommandLine args(argc,argv,bool_opts);
// need at least 3 arguments - the program name, an
input and an output
! if (argc < 3)
{
DisplayHelp();
--- 139,155 ----
bool_opts.insert("motion_colour");
bool_opts.insert("motion_arrows");
! bool_opts.insert("motion_colour_arrows");
bool_opts.insert("split_mode");
bool_opts.insert("sad");
! bool_opts.insert("pred_mode");
bool_opts.insert("global");
bool_opts.insert("global_diff");
bool_opts.insert("global_inliers");
!
// parse command line options
CommandLine args(argc,argv,bool_opts);
// need at least 3 arguments - the program name, an
input and an output
! if (argc < 3)
{
DisplayHelp();
***************
*** 178,185 ****
if (opt->m_name ==
"motion_arrows")
oparams.SetOption(motion_arrows);
!
else if (opt->m_name ==
"motion_colour_arrows")
oparams.SetOption(motion_colour_arrows);
!
else if (opt->m_name ==
"motion_colour")
oparams.SetOption(motion_colour);
--- 178,185 ----
if (opt->m_name ==
"motion_arrows")
oparams.SetOption(motion_arrows);
!
else if (opt->m_name ==
"motion_colour_arrows")
oparams.SetOption(motion_colour_arrows);
!
else if (opt->m_name ==
"motion_colour")
oparams.SetOption(motion_colour);
***************
*** 210,221 ****
if (oparams.Option() == motion_arrows)
oparams.SetOption(gm_arrows);
!
if (oparams.Option() ==
motion_colour_arrows)
oparams.SetOption(gm_colour_arrows);
!
if (oparams.Option() == motion_colour)
oparams.SetOption(gm_colour);
}
!
if (opt->m_name ==
"global_diff")
{
--- 210,221 ----
if (oparams.Option() == motion_arrows)
oparams.SetOption(gm_arrows);
!
if (oparams.Option() ==
motion_colour_arrows)
oparams.SetOption(gm_colour_arrows);
!
if (oparams.Option() == motion_colour)
oparams.SetOption(gm_colour);
}
!
if (opt->m_name ==
"global_diff")
{
***************
*** 223,236 ****
|| oparams.Option() == gm_arrows)
oparams.SetOption(gm_diff_arrows);
!
if (oparams.Option() ==
motion_colour_arrows
|| oparams.Option() ==
gm_colour_arrows)
oparams.SetOption(gm_diff_colour_arrows);
!
if (oparams.Option() == motion_colour
|| oparams.Option() == gm_colour)
oparams.SetOption(gm_diff_colour);
}
!
}
--- 223,236 ----
|| oparams.Option() == gm_arrows)
oparams.SetOption(gm_diff_arrows);
!
if (oparams.Option() ==
motion_colour_arrows
|| oparams.Option() ==
gm_colour_arrows)
oparams.SetOption(gm_diff_colour_arrows);
!
if (oparams.Option() == motion_colour
|| oparams.Option() == gm_colour)
oparams.SetOption(gm_diff_colour);
}
!
}
***************
*** 280,287 ****
{
buffer =
strtoul(opt->m_value.c_str(),NULL,10);
! } // m_name
} // opt
} // args > 3
!
// read motion data from file
if (verbose) cerr << endl << "Opening
motion data file ";
--- 280,287 ----
{
buffer =
strtoul(opt->m_value.c_str(),NULL,10);
! } // m_name
} // opt
} // args > 3
!
// read motion data from file
if (verbose) cerr << endl << "Opening
motion data file ";
***************
*** 291,295 ****
if (verbose) cerr << mv_file;
ifstream in(mv_file, ios::in);
!
if (!in)
{
--- 291,295 ----
if (verbose) cerr << mv_file;
ifstream in(mv_file, ios::in);
!
if (!in)
{
***************
*** 300,303 ****
--- 300,304 ----
SourceParams srcparams;
ReadSequenceParams (in, srcparams);
+ SourceParams out_srcparams(srcparams);
// Create objects for input and output picture
sequences
***************
*** 305,313 ****
strcpy(yuv_file, input.c_str());
strcat(yuv_file, ".localdec.yuv");
! FileStreamInput inputpic(yuv_file, srcparams);
-
- FileStreamOutput outputpic(output.c_str(),
srcparams);
-
if (verbose) cerr << " ... ok"
<< endl << "Processing sequence...";
// *** process the sequence ***
--- 306,315 ----
strcpy(yuv_file, input.c_str());
strcat(yuv_file, ".localdec.yuv");
! FileStreamInput inputpic(yuv_file, srcparams,
srcparams.Interlace());
!
! if (out_srcparams.Interlace())
! out_srcparams.SetYl(out_srcparams.Yl()>>1);
! FileStreamOutput outputpic(output.c_str(),
out_srcparams, false);
if (verbose) cerr << " ... ok"
<< endl << "Processing sequence...";
// *** process the sequence ***
------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
a>
_______________________________________________
Dirac-commits mailing list
Dirac-commits lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dirac-com
mits
|