File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 7575 int real_width = width;
7676
7777 if (type_ == kWindow ) {
78- // A multiple of 32 must be used as the width of the src frame,
78+ int multiple = 0 ;
79+ #if defined(WEBRTC_ARCH_X86_FAMILY)
80+ multiple = 16 ;
81+ #elif defined(WEBRTC_ARCH_ARM64)
82+ multiple = 32 ;
83+ #endif
84+ // A multiple of $multiple must be used as the width of the src frame,
7985 // and the right black border needs to be cropped during conversion.
80- if ( (width % 32 ) != 0 ) {
81- width = (width / 32 + 1 ) * 32 ;
86+ if ( multiple != 0 && (width % multiple ) != 0 ) {
87+ width = (width / multiple + 1 ) * multiple ;
8288 }
8389 }
8490
8591 if (!i420_buffer_ || !i420_buffer_.get () ||
8692 i420_buffer_->width () * i420_buffer_->height () != real_width * height) {
87-
88-
89-
9093 i420_buffer_ = webrtc::I420Buffer::Create (real_width, height);
9194 }
95+
9296 libyuv::ConvertToI420 (frame->data (),
9397 0 ,
9498 i420_buffer_->MutableDataY (),
Original file line number Diff line number Diff line change 166166 int real_width = width;
167167
168168 if (type_ == kWindow ) {
169- // A multiple of 32 must be used as the width of the src frame,
169+ int multiple = 0 ;
170+ #if defined(WEBRTC_ARCH_X86_FAMILY)
171+ multiple = 16 ;
172+ #elif defined(WEBRTC_ARCH_ARM64)
173+ multiple = 32 ;
174+ #endif
175+ // A multiple of $multiple must be used as the width of the src frame,
170176 // and the right black border needs to be cropped during conversion.
171- if ( (width % 32 ) != 0 ) {
172- width = (width / 32 + 1 ) * 32 ;
177+ if ( multiple != 0 && (width % multiple ) != 0 ) {
178+ width = (width / multiple + 1 ) * multiple ;
173179 }
174180 }
175181
You can’t perform that action at this time.
0 commit comments