📄 umc_h264_debug.cpp
字号:
//// INTEL CORPORATION PROPRIETARY INFORMATION// This software is supplied under the terms of a license agreement or// nondisclosure agreement with Intel Corporation and may not be copied// or disclosed except in accordance with the terms of that agreement.// Copyright (c) 2004 - 2005 Intel Corporation. All Rights Reserved.//#include <stdlib.h>#include <stdio.h>#include <string.h>#include "umc_h264_video_encoder.h"namespace UMC{voidwriteimage( const char *filename, Ipp8u *pImageY, Ipp8u *pImageU, Ipp8u *pImageV, Ipp32u uWidth, Ipp32u uHeight, Ipp32u uPitch, bool bShiftChromaLeft, const char *openFlags ){ size_t numwritten; Ipp32u i, s; Ipp8u *ptr; Ipp8u *shiftPtr, *shiftBuffer = 0; FILE *file = fopen( filename, openFlags ); if ( file == NULL ) { return; } if ( bShiftChromaLeft ) { shiftBuffer = (Ipp8u *)H264_Allocate( uWidth, true); if (NULL == shiftBuffer) { bShiftChromaLeft = false; } } ptr = pImageY; for (i = 0; i < uHeight; i++) { if ( bShiftChromaLeft ) { memcpy(shiftBuffer, ptr, uWidth); for ( s = 0, shiftPtr = shiftBuffer; s < uWidth; s++ ) { *shiftPtr <<= 1; shiftPtr++; } numwritten = fwrite( (const void *)shiftBuffer, sizeof( char ), uWidth, file ); } else { numwritten = fwrite( (const void *)ptr, sizeof( char ), uWidth, file ); } ptr += uPitch; } ptr = pImageU; for (i = 0; i < uHeight/2; i++) { if ( bShiftChromaLeft ) { memcpy( shiftBuffer, ptr, uWidth/2 ); for ( s = 0, shiftPtr = shiftBuffer; s < uWidth/2; s++ ) { *shiftPtr <<= 1; shiftPtr++; } numwritten = fwrite( (const void *)shiftBuffer, sizeof( char ), uWidth/2, file ); } else { numwritten = fwrite( (const void *)ptr, sizeof( char ), uWidth/2, file ); } ptr += uPitch; } ptr = pImageV; for (i = 0; i < uHeight/2; i++) { if ( bShiftChromaLeft ) { memcpy( shiftBuffer, ptr, uWidth/2 ); for ( s = 0, shiftPtr = shiftBuffer; s < uWidth/2; s++ ) { *shiftPtr <<= 1; shiftPtr++; } numwritten = fwrite( (const void *)shiftBuffer, sizeof( char ), uWidth/2, file ); } else { numwritten = fwrite( (const void *)ptr, sizeof( char ), uWidth/2, file ); } ptr += uPitch; } if ( bShiftChromaLeft ) { H264_Free( shiftBuffer ); } fclose( file );}} //namespace UMC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -