EncodeDlg.cpp
上传用户:szklck
上传日期:2007-01-22
资源大小:925k
文件大小:3k
源码类别:

图形图像处理

开发平台:

Visual C++

  1. // EncodeDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "视频编解码器.h"
  5. #include "EncodeDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CEncodeDlg property page
  13. IMPLEMENT_DYNCREATE(CEncodeDlg, CPropertyPage)
  14. CEncodeDlg::CEncodeDlg() : CPropertyPage(CEncodeDlg::IDD)
  15. {
  16. //{{AFX_DATA_INIT(CEncodeDlg)
  17. m_ifPsnr = FALSE;
  18. m_InitDir = _T("F:\standard_pictures\MISSUSA_raw\mobile.yuv");
  19. m_InType = _T("yuv文件");
  20. m_MaxFrame = 120;
  21. m_Pbetween = 19;
  22. m_QP = 4;
  23. m_QPI = 8;
  24. //}}AFX_DATA_INIT
  25. typeindex=2;
  26. }
  27. CEncodeDlg::~CEncodeDlg()
  28. {
  29. }
  30. void CEncodeDlg::DoDataExchange(CDataExchange* pDX)
  31. {
  32. CPropertyPage::DoDataExchange(pDX);
  33. //{{AFX_DATA_MAP(CEncodeDlg)
  34. DDX_Check(pDX, IDC_CHECK1, m_ifPsnr);
  35. DDX_Text(pDX, IDC_InitDir, m_InitDir);
  36. DDX_CBString(pDX, IDC_InType, m_InType);
  37. DDX_Text(pDX, IDC_MaxFrame, m_MaxFrame);
  38. DDV_MinMaxInt(pDX, m_MaxFrame, 3, 500);
  39. DDX_Text(pDX, IDC_Pnum, m_Pbetween);
  40. DDV_MinMaxInt(pDX, m_Pbetween, 0, 29);
  41. DDX_Text(pDX, IDC_QP, m_QP);
  42. DDV_MinMaxInt(pDX, m_QP, 2, 31);
  43. DDX_Text(pDX, IDC_QPI, m_QPI);
  44. DDV_MinMaxInt(pDX, m_QPI, 2, 31);
  45. //}}AFX_DATA_MAP
  46. }
  47. BEGIN_MESSAGE_MAP(CEncodeDlg, CPropertyPage)
  48. //{{AFX_MSG_MAP(CEncodeDlg)
  49. ON_BN_CLICKED(IDC_Browse, OnBrowse)
  50. //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CEncodeDlg message handlers
  54. void CEncodeDlg::OnBrowse() 
  55. {
  56. UpdateData(true);
  57.     static char szFilter[] = "BMP Files(*.bmp)|*.bmp|YUV File(*.yuv)|*.yuv|RAW Files(*.raw)|*.raw|SIF Files(*.sif)|*.sif|";
  58. CFileDialog FileDlg( TRUE, NULL,NULL,OFN_HIDEREADONLY, szFilter);
  59. FileDlg.m_ofn.lpstrInitialDir="F:\standard_pictures\MISSUSA_raw";
  60. if(m_InType=="bmp序列")
  61.         typeindex=1;
  62. else if(m_InType=="YUV文件")
  63.     typeindex=2;
  64. else if(m_InType=="raw序列")
  65. typeindex=3;
  66. else if(m_InType=="sif 序列")
  67. typeindex=4;
  68. FileDlg.m_ofn.nFilterIndex=typeindex;
  69.     if( FileDlg.DoModal() == IDOK ) 
  70. {
  71. m_InitDir=FileDlg.GetPathName();
  72.        CString dd=FileDlg.GetFileExt();
  73. CString szFileExt = "bmpyuvrawsif";
  74. dd.MakeLower();
  75. int type= szFileExt.Find(dd);
  76. if(typeindex!=type/3+1)
  77. {  
  78. AfxMessageBox("文件类型错误!");
  79.             m_InitDir = "F:\standard_pictures\MISSUSA_raw\mobile.yuv";
  80.     m_InType=="yuv文件";
  81.     typeindex=2;
  82. }
  83. }
  84. else
  85. {  
  86.  m_InitDir = "F:\standard_pictures\MISSUSA_raw\mobile.yuv";
  87.  m_InType=="yuv文件";
  88.  typeindex=2;
  89. }
  90.     UpdateData(false);
  91. }
  92. BOOL CEncodeDlg::OnInitDialog() 
  93. {
  94. CDialog::OnInitDialog();
  95. // TODO: Add extra initialization here
  96.     browse.AutoLoad(IDC_Browse,this);
  97. browse.SizeToContent();
  98. return TRUE;  // return TRUE unless you set the focus to a control
  99.               // EXCEPTION: OCX Property Pages should return FALSE
  100. }