]> git.sesse.net Git - casparcg/commitdiff
Use fast_memcpy in more places
authorHelge Norberg <helge.norberg@svt.se>
Mon, 30 Nov 2015 20:59:29 +0000 (21:59 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Mon, 30 Nov 2015 20:59:29 +0000 (21:59 +0100)
modules/html/producer/html_producer.cpp
modules/reroute/producer/channel_producer.cpp
modules/screen/consumer/screen_consumer.cpp

index 30d8ed06fb651da7009bff13328bd30c791e3ac0..551b5a83ba1e9fdc0be01d00b9651dffe17594fa 100644 (file)
@@ -44,6 +44,7 @@
 #include <common/prec_timer.h>
 #include <common/linq.h>
 #include <common/os/filesystem.h>
+#include <common/memcpy.h>
 
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/filesystem.hpp>
@@ -211,7 +212,7 @@ private:
                        pixel_desc.planes.push_back(
                                core::pixel_format_desc::plane(width, height, 4));
                auto frame = frame_factory_->create_frame(this, pixel_desc, core::audio_channel_layout::invalid());
-               A_memcpy(frame.image_data().begin(), buffer, width * height * 4);
+               fast_memcpy(frame.image_data().begin(), buffer, width * height * 4);
 
                lock(frames_mutex_, [&]
                {
@@ -310,6 +311,7 @@ private:
                        browser_->SendProcessMessage(
                                        CefProcessId::PID_RENDERER,
                                        CefProcessMessage::Create(TICK_MESSAGE_NAME));
+
                graph_->set_value("tick-time", tick_timer_.elapsed()
                                * format_desc_.fps
                                * format_desc_.field_count
index 7720cd0845043a4ba0d472935de191f7a5371364..335211307cc3083309065ccae5e9f6a84ef6ea55 100644 (file)
@@ -44,6 +44,7 @@
 #include <common/except.h>
 #include <common/memory.h>
 #include <common/future.h>
+#include <common/memcpy.h>
 
 #include <tbb/concurrent_queue.h>
 
@@ -270,7 +271,7 @@ public:
                        boost::copy(read_frame.audio_data(), std::back_inserter(frame.audio_data()));
                }
 
-               A_memcpy(frame.image_data().begin(), read_frame.image_data().begin(), read_frame.image_data().size());
+               fast_memcpy(frame.image_data().begin(), read_frame.image_data().begin(), read_frame.image_data().size());
 
                frame_buffer_.push(core::draw_frame(std::move(frame)));
                
index 09434790c3a5454ff7a8572e3de2b130a01f13c3..ae8960b4c48af701a14f1ab0bf78f3c96ef7cfa8 100644 (file)
@@ -30,6 +30,7 @@
 #include <common/memory.h>
 #include <common/array.h>
 #include <common/memshfl.h>
+#include <common/memcpy.h>
 #include <common/utf.h>
 #include <common/prec_timer.h>
 #include <common/future.h>
@@ -503,12 +504,8 @@ public:
                                });
                        }
                        else
-                       {       
-                               tbb::parallel_for(tbb::blocked_range<int>(0, format_desc_.height), [&](const tbb::blocked_range<int>& r)
-                               {
-                                       for(int n = r.begin(); n != r.end(); ++n)
-                                               A_memcpy(ptr+n*format_desc_.width*4, av_frame->data[0]+n*av_frame->linesize[0], format_desc_.width*4);
-                               });
+                       {
+                               fast_memcpy(ptr, av_frame->data[0], format_desc_.size);
                        }
                        
                        GL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); // release the mapped buffer