Changeset 0db7b30 in ffmpeg
- Timestamp:
- Dec 18, 2011, 12:20:18 AM (13 years ago)
- Branches:
- master
- Children:
- 8beeec88
- Parents:
- 21dfd159
- git-author:
- Michael Niedermayer <michaelni@gmx.at> (12/17/11 23:09:26)
- git-committer:
- Michael Niedermayer <michaelni@gmx.at> (12/18/11 00:20:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libavcodec/lagarith.c
r21dfd159 r0db7b30 525 525 } 526 526 break; 527 case FRAME_ARITH_RGB24: 528 avctx->pix_fmt = PIX_FMT_RGB24; 529 530 if (avctx->get_buffer(avctx, p) < 0) { 531 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); 532 return -1; 533 } 534 offs[0] = offset_bv; 535 offs[1] = offset_gu; 536 offs[2] = 9; 537 538 if (!l->rgb_planes) { 539 l->rgb_stride = FFALIGN(avctx->width, 16); 540 l->rgb_planes = av_malloc(l->rgb_stride * avctx->height * 3); 541 if (!l->rgb_planes) { 542 av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n"); 543 return AVERROR(ENOMEM); 544 } 545 } 546 for (i = 0; i < 3; i++) 547 srcs[i] = l->rgb_planes + (i + 1) * l->rgb_stride * avctx->height - l->rgb_stride; 548 for (i = 0; i < 3; i++) 549 lag_decode_arith_plane(l, srcs[i], 550 avctx->width, avctx->height, 551 -l->rgb_stride, buf + offs[i], 552 buf_size); 553 dst = p->data[0]; 554 for (i = 0; i < 3; i++) 555 srcs[i] = l->rgb_planes + i * l->rgb_stride * avctx->height; 556 for (j = 0; j < avctx->height; j++) { 557 for (i = 0; i < avctx->width; i++) { 558 uint8_t r, g, b; 559 r = srcs[0][i]; 560 g = srcs[1][i]; 561 b = srcs[2][i]; 562 dst[3*i+0] = r+g; 563 dst[3*i+1] = g; 564 dst[3*i+2] = b+g; 565 } 566 dst += p->linesize[0]; 567 for (i = 0; i < 3; i++) 568 srcs[i] += l->rgb_stride; 569 } 570 break; 527 571 case FRAME_ARITH_YV12: 528 572 avctx->pix_fmt = PIX_FMT_YUV420P;
Note:
See TracChangeset
for help on using the changeset viewer.