You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/bmpenc: Use memcpy when data has desired endianness
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
@@ -139,7 +141,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
ptr = p->data[0] + (avctx->height - 1) * p->linesize[0];
|
ptr = p->data[0] + (avctx->height - 1) * p->linesize[0];
|
||||||
buf = pkt->data + hsize;
|
buf = pkt->data + hsize;
|
||||||
for(i = 0; i < avctx->height; i++) {
|
for(i = 0; i < avctx->height; i++) {
|
||||||
if (bit_count == 16) {
|
if (HAVE_BIGENDIAN && bit_count == 16) {
|
||||||
const uint16_t *src = (const uint16_t *) ptr;
|
const uint16_t *src = (const uint16_t *) ptr;
|
||||||
for(n = 0; n < avctx->width; n++)
|
for(n = 0; n < avctx->width; n++)
|
||||||
AV_WL16(buf + 2 * n, src[n]);
|
AV_WL16(buf + 2 * n, src[n]);
|
||||||
|
Reference in New Issue
Block a user