summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-02-27 22:08:41 +0100
committerDiego Biurrun <diego@biurrun.de>2012-03-01 23:11:13 +0100
commit324deaa26883efbdac3b82d4b06eee0285826a7f (patch)
treefc9531cb91ac14c2135050c7020d0f03d2fcafa2 /libavcodec
parent47c0ac96aa3530aad9fbc5250a531589f251d4d7 (diff)
Replace AVFrame pointer type punning by proper struct member assignments.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/asv1.c2
-rw-r--r--libavcodec/avs.c2
-rw-r--r--libavcodec/cavsdec.c6
-rw-r--r--libavcodec/h261dec.c3
-rw-r--r--libavcodec/h263dec.c6
-rw-r--r--libavcodec/h264.c26
-rw-r--r--libavcodec/h264_direct.c3
-rw-r--r--libavcodec/indeo2.c2
-rw-r--r--libavcodec/mpeg12.c6
-rw-r--r--libavcodec/pnmdec.c2
-rw-r--r--libavcodec/rv10.c4
-rw-r--r--libavcodec/rv34.c6
-rw-r--r--libavcodec/svq1dec.c2
-rw-r--r--libavcodec/svq3.c6
-rw-r--r--libavcodec/targa.c2
-rw-r--r--libavcodec/tiff.c2
-rw-r--r--libavcodec/vc1dec.c6
-rw-r--r--libavcodec/vcr1.c2
18 files changed, 38 insertions, 50 deletions
diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c
index 94073c087e..8dfe276f93 100644
--- a/libavcodec/asv1.c
+++ b/libavcodec/asv1.c
@@ -454,7 +454,7 @@ static int decode_frame(AVCodecContext *avctx,
}
}
- *picture= *(AVFrame*)&a->picture;
+ *picture = a->picture;
*data_size = sizeof(AVPicture);
emms_c();
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index ce119ebd72..f4d8f69610 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -149,7 +149,7 @@ avs_decode_frame(AVCodecContext * avctx,
align_get_bits(&change_map);
}
- *picture = *(AVFrame *) & avs->picture;
+ *picture = avs->picture;
*data_size = sizeof(AVPicture);
return buf_size;
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index f59c73ad1c..1da4eb1922 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -655,7 +655,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
if (buf_size == 0) {
if (!s->low_delay && h->DPB[0].f.data[0]) {
*data_size = sizeof(AVPicture);
- *picture = *(AVFrame *) &h->DPB[0];
+ *picture = h->DPB[0].f;
}
return 0;
}
@@ -691,12 +691,12 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
*data_size = sizeof(AVPicture);
if(h->pic_type != AV_PICTURE_TYPE_B) {
if(h->DPB[1].f.data[0]) {
- *picture = *(AVFrame *) &h->DPB[1];
+ *picture = h->DPB[1].f;
} else {
*data_size = 0;
}
} else
- *picture = *(AVFrame *) &h->picture;
+ *picture = h->picture.f;
break;
case EXT_START_CODE:
//mpeg_decode_extension(avctx,buf_ptr, input_size);
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 38d5e2efc3..dd1931d6da 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -624,7 +624,8 @@ retry:
assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
assert(s->current_picture.f.pict_type == s->pict_type);
- *pict= *(AVFrame*)s->current_picture_ptr;
+
+ *pict = s->current_picture_ptr->f;
ff_print_debug_info(s, pict);
*data_size = sizeof(AVFrame);
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 4f0e4563da..992e5fd32b 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -355,7 +355,7 @@ uint64_t time= rdtsc();
if (buf_size == 0) {
/* special case for last picture */
if (s->low_delay==0 && s->next_picture_ptr) {
- *pict= *(AVFrame*)s->next_picture_ptr;
+ *pict = s->next_picture_ptr->f;
s->next_picture_ptr= NULL;
*data_size = sizeof(AVFrame);
@@ -712,9 +712,9 @@ intrax8_decoded:
assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
assert(s->current_picture.f.pict_type == s->pict_type);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
+ *pict = s->current_picture_ptr->f;
} else if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
+ *pict = s->last_picture_ptr->f;
}
if(s->last_picture_ptr || s->low_delay){
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index afa9c2747d..36a4e2bb03 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -361,26 +361,14 @@ static void await_references(H264Context *h){
nrefs[list]--;
if(!FIELD_PICTURE && ref_field_picture){ // frame referencing two fields
- ff_thread_await_progress(&ref_pic->f,
- FFMIN((row >> 1) - !(row & 1),
- pic_height - 1),
- 1);
- ff_thread_await_progress(&ref_pic->f,
- FFMIN((row >> 1), pic_height - 1),
- 0);
+ ff_thread_await_progress(&ref_pic->f, FFMIN((row >> 1) - !(row & 1), pic_height - 1), 1);
+ ff_thread_await_progress(&ref_pic->f, FFMIN((row >> 1), pic_height - 1), 0);
}else if(FIELD_PICTURE && !ref_field_picture){ // field referencing one field of a frame
- ff_thread_await_progress(&ref_pic->f,
- FFMIN(row * 2 + ref_field,
- pic_height - 1),
- 0);
+ ff_thread_await_progress(&ref_pic->f, FFMIN(row * 2 + ref_field, pic_height - 1), 0);
}else if(FIELD_PICTURE){
- ff_thread_await_progress(&ref_pic->f,
- FFMIN(row, pic_height - 1),
- ref_field);
+ ff_thread_await_progress(&ref_pic->f, FFMIN(row, pic_height - 1), ref_field);
}else{
- ff_thread_await_progress(&ref_pic->f,
- FFMIN(row, pic_height - 1),
- 0);
+ ff_thread_await_progress(&ref_pic->f, FFMIN(row, pic_height - 1), 0);
}
}
}
@@ -4053,7 +4041,7 @@ static int decode_frame(AVCodecContext *avctx,
if(out){
*data_size = sizeof(AVFrame);
- *pict= *(AVFrame*)out;
+ *pict = out->f;
}
return buf_index;
@@ -4087,7 +4075,7 @@ static int decode_frame(AVCodecContext *avctx,
} else {
*data_size = sizeof(AVFrame);
- *pict = *(AVFrame*)h->next_output_pic;
+ *pict = h->next_output_pic->f;
}
}
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index d72c67b586..9010cacfd9 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -154,8 +154,7 @@ static void await_reference_mb_row(H264Context * const h, Picture *ref, int mb_y
//even if pixels aren't deblocked yet
ff_thread_await_progress(&ref->f,
- FFMIN(16 * mb_y >> ref_field_picture,
- ref_height - 1),
+ FFMIN(16 * mb_y >> ref_field_picture, ref_height - 1),
ref_field_picture && ref_field);
}
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index b114573ff0..6761c59eed 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -191,7 +191,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
s->picture.data[1], s->picture.linesize[1], ir2_luma_table);
}
- *picture= *(AVFrame*)&s->picture;
+ *picture = s->picture;
*data_size = sizeof(AVPicture);
return buf_size;
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 4b526eb6ef..a5dafbd1fc 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1915,7 +1915,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict = *(AVFrame*)s->current_picture_ptr;
+ *pict = s->current_picture_ptr->f;
ff_print_debug_info(s, pict);
} else {
if (avctx->active_thread_type & FF_THREAD_FRAME)
@@ -1923,7 +1923,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
/* latency of 1 frame for I- and P-frames */
/* XXX: use another variable than picture_number */
if (s->last_picture_ptr != NULL) {
- *pict = *(AVFrame*)s->last_picture_ptr;
+ *pict = s->last_picture_ptr->f;
ff_print_debug_info(s, pict);
}
}
@@ -2203,7 +2203,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
/* special case for last picture */
if (s2->low_delay == 0 && s2->next_picture_ptr) {
- *picture = *(AVFrame*)s2->next_picture_ptr;
+ *picture = s2->next_picture_ptr->f;
s2->next_picture_ptr = NULL;
*data_size = sizeof(AVFrame);
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index ada0fd8a36..50e8bce168 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -180,7 +180,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
}
break;
}
- *picture = *(AVFrame*)&s->picture;
+ *picture = s->picture;
*data_size = sizeof(AVPicture);
return s->bytestream - s->bytestream_start;
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 75d529f42d..6e6516feeb 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -677,9 +677,9 @@ static int rv10_decode_frame(AVCodecContext *avctx,
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
+ *pict = s->current_picture_ptr->f;
} else if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
+ *pict = s->last_picture_ptr->f;
}
if(s->last_picture_ptr || s->low_delay){
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index e15affeb8d..cf74eab56f 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1656,7 +1656,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if (buf_size == 0) {
/* special case for last picture */
if (s->low_delay==0 && s->next_picture_ptr) {
- *pict = *(AVFrame*)s->next_picture_ptr;
+ *pict = s->next_picture_ptr->f;
s->next_picture_ptr = NULL;
*data_size = sizeof(AVFrame);
@@ -1743,9 +1743,9 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict = *(AVFrame*)s->current_picture_ptr;
+ *pict = s->current_picture_ptr->f;
} else if (s->last_picture_ptr != NULL) {
- *pict = *(AVFrame*)s->last_picture_ptr;
+ *pict = s->last_picture_ptr->f;
}
if(s->last_picture_ptr || s->low_delay){
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 80f96c8cc6..a831459611 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -735,7 +735,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
}
}
- *pict = *(AVFrame*)&s->current_picture;
+ *pict = s->current_picture.f;
ff_MPV_frame_end(s);
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 73de55a457..e157061f64 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -956,7 +956,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
/* special case for last picture */
if (buf_size == 0) {
if (s->next_picture_ptr && !s->low_delay) {
- *(AVFrame *) data = *(AVFrame *) &s->next_picture;
+ *(AVFrame *) data = s->next_picture.f;
s->next_picture_ptr = NULL;
*data_size = sizeof(AVFrame);
}
@@ -1076,9 +1076,9 @@ static int svq3_decode_frame(AVCodecContext *avctx,
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *(AVFrame *) data = *(AVFrame *) &s->current_picture;
+ *(AVFrame *) data = s->current_picture.f;
} else {
- *(AVFrame *) data = *(AVFrame *) &s->last_picture;
+ *(AVFrame *) data = s->last_picture.f;
}
/* Do not output the last pic after seeking. */
diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 94a50fbb79..d5559145a5 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -248,7 +248,7 @@ static int decode_frame(AVCodecContext *avctx,
}
}
- *picture= *(AVFrame*)&s->picture;
+ *picture = s->picture;
*data_size = sizeof(AVPicture);
return avpkt->size;
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 57720a5018..0ff6ceb7cc 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -607,7 +607,7 @@ static int decode_frame(AVCodecContext *avctx,
src += s->picture.linesize[0];
}
}
- *picture= *(AVFrame*)&s->picture;
+ *picture = s->picture;
*data_size = sizeof(AVPicture);
return buf_size;
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 8ab92b4177..4a991f0149 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5449,7 +5449,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) {
/* special case for last picture */
if (s->low_delay == 0 && s->next_picture_ptr) {
- *pict = *(AVFrame*)s->next_picture_ptr;
+ *pict = s->next_picture_ptr->f;
s->next_picture_ptr = NULL;
*data_size = sizeof(AVFrame);
@@ -5755,9 +5755,9 @@ image:
*data_size = sizeof(AVFrame);
} else {
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- *pict = *(AVFrame*)s->current_picture_ptr;
+ *pict = s->current_picture_ptr->f;
} else if (s->last_picture_ptr != NULL) {
- *pict = *(AVFrame*)s->last_picture_ptr;
+ *pict = s->last_picture_ptr->f;
}
if (s->last_picture_ptr || s->low_delay) {
*data_size = sizeof(AVFrame);
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index bace3a34b8..c0a0a1cdb6 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -111,7 +111,7 @@ static int decode_frame(AVCodecContext *avctx,
}
}
- *picture= *(AVFrame*)&a->picture;
+ *picture = a->picture;
*data_size = sizeof(AVPicture);
return buf_size;