diff options
author | mikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-10-04 20:21:30 +0000 |
---|---|---|
committer | mikhal@webrtc.org <mikhal@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-10-04 20:21:30 +0000 |
commit | 064085032faed5598251710a3790b4ceaba5b192 (patch) | |
tree | b754d3e274f6bd500df3232ce45598ea57ab85f4 /modules/video_processing/main | |
parent | 321361689ec7da203e0fa5727daeee1b18064cb5 (diff) | |
download | webrtc-064085032faed5598251710a3790b4ceaba5b192.tar.gz |
VPM: Fixing namespace
R=marpan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/2355004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4930 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'modules/video_processing/main')
3 files changed, 46 insertions, 44 deletions
diff --git a/modules/video_processing/main/source/color_enhancement.cc b/modules/video_processing/main/source/color_enhancement.cc index bbe23793..eeec0165 100644 --- a/modules/video_processing/main/source/color_enhancement.cc +++ b/modules/video_processing/main/source/color_enhancement.cc @@ -15,43 +15,42 @@ #include "webrtc/system_wrappers/interface/trace.h" namespace webrtc { - namespace VideoProcessing { - int32_t ColorEnhancement(I420VideoFrame* frame) { - assert(frame); - // Pointers to U and V color pixels. - uint8_t* ptr_u; - uint8_t* ptr_v; - uint8_t temp_chroma; - if (frame->IsZeroSize()) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, - -1, "Null frame pointer"); - return VPM_GENERAL_ERROR; - } - - if (frame->width() == 0 || frame->height() == 0) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, - -1, "Invalid frame size"); - return VPM_GENERAL_ERROR; - } - - // set pointers to first U and V pixels (skip luminance) - ptr_u = frame->buffer(kUPlane); - ptr_v = frame->buffer(kVPlane); - int size_uv = ((frame->width() + 1) / 2) * ((frame->height() + 1) / 2); - - // Loop through all chrominance pixels and modify color - for (int ix = 0; ix < size_uv; ix++) { - temp_chroma = colorTable[*ptr_u][*ptr_v]; - *ptr_v = colorTable[*ptr_v][*ptr_u]; - *ptr_u = temp_chroma; - - ptr_u++; - ptr_v++; - } - return VPM_OK; + +int32_t ColorEnhancement(I420VideoFrame* frame) { +assert(frame); +// Pointers to U and V color pixels. +uint8_t* ptr_u; +uint8_t* ptr_v; +uint8_t temp_chroma; +if (frame->IsZeroSize()) { + WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, + -1, "Null frame pointer"); + return VPM_GENERAL_ERROR; } -} // namespace VideoProcessing +if (frame->width() == 0 || frame->height() == 0) { + WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoPreocessing, + -1, "Invalid frame size"); + return VPM_GENERAL_ERROR; +} + +// Set pointers to first U and V pixels (skip luminance). +ptr_u = frame->buffer(kUPlane); +ptr_v = frame->buffer(kVPlane); +int size_uv = ((frame->width() + 1) / 2) * ((frame->height() + 1) / 2); +// Loop through all chrominance pixels and modify color. +for (int ix = 0; ix < size_uv; ix++) { + temp_chroma = colorTable[*ptr_u][*ptr_v]; + *ptr_v = colorTable[*ptr_v][*ptr_u]; + *ptr_u = temp_chroma; + + ptr_u++; + ptr_v++; +} +return VPM_OK; +} + +} // namespace VideoProcessing } // namespace webrtc diff --git a/modules/video_processing/main/source/color_enhancement.h b/modules/video_processing/main/source/color_enhancement.h index 9bf4ee98..233a47fe 100644 --- a/modules/video_processing/main/source/color_enhancement.h +++ b/modules/video_processing/main/source/color_enhancement.h @@ -18,11 +18,11 @@ #include "webrtc/typedefs.h" namespace webrtc { - namespace VideoProcessing { - int32_t ColorEnhancement(I420VideoFrame* frame); -} +int32_t ColorEnhancement(I420VideoFrame* frame); + +} // namespace VideoProcessing } // namespace webrtc #endif // WEBRTC_MODULES_VIDEO_PROCESSING_COLOR_ENHANCEMENT_H diff --git a/modules/video_processing/main/source/color_enhancement_private.h b/modules/video_processing/main/source/color_enhancement_private.h index 0b489157..e5789105 100644 --- a/modules/video_processing/main/source/color_enhancement_private.h +++ b/modules/video_processing/main/source/color_enhancement_private.h @@ -8,15 +8,16 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef VPM_COLOR_ENHANCEMENT_PRIVATE_H -#define VPM_COLOR_ENHANCEMENT_PRIVATE_H +#ifndef WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_COLOR_ENHANCEMENT_PRIVATE_H_ +#define WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_COLOR_ENHANCEMENT_PRIVATE_H_ #include "webrtc/typedefs.h" namespace webrtc { +namespace VideoProcessing { -//Table created with Matlab script createTable.m -//Usage: +// Table created with Matlab script createTable.m +// Usage: // Umod=colorTable[U][V] // Vmod=colorTable[V][U] static const uint8_t colorTable[256][256] = { @@ -278,6 +279,8 @@ static const uint8_t colorTable[256][256] = { {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255} }; -} // namespace -#endif // VPM_COLOR_ENHANCEMENT_PRIVATE_H
\ No newline at end of file +} // namespace VideoProcessing +} // namespace webrtc + +#endif // WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_COLOR_ENHANCEMENT_PRIVATE_H_ |