Commit 2f944356 authored by Loren Merritt's avatar Loren Merritt

H.264: decode arbitrary frame orders and allow B-frames as references.

Originally committed as revision 4003 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 2f1e1ed3
This diff is collapsed.
...@@ -1471,7 +1471,8 @@ alloc: ...@@ -1471,7 +1471,8 @@ alloc:
pic= (AVFrame*)&s->picture[i]; pic= (AVFrame*)&s->picture[i];
} }
pic->reference= s->pict_type != B_TYPE && !s->dropable ? 3 : 0; pic->reference= (s->pict_type != B_TYPE || s->codec_id == CODEC_ID_H264)
&& !s->dropable ? 3 : 0;
pic->coded_picture_number= s->coded_picture_number++; pic->coded_picture_number= s->coded_picture_number++;
...@@ -1566,7 +1567,7 @@ void MPV_frame_end(MpegEncContext *s) ...@@ -1566,7 +1567,7 @@ void MPV_frame_end(MpegEncContext *s)
XVMC_field_end(s); XVMC_field_end(s);
}else }else
#endif #endif
if(s->unrestricted_mv && s->pict_type != B_TYPE && !s->intra_only && !(s->flags&CODEC_FLAG_EMU_EDGE)) { if(s->unrestricted_mv && s->current_picture.reference && !s->intra_only && !(s->flags&CODEC_FLAG_EMU_EDGE)) {
draw_edges(s->current_picture.data[0], s->linesize , s->h_edge_pos , s->v_edge_pos , EDGE_WIDTH ); draw_edges(s->current_picture.data[0], s->linesize , s->h_edge_pos , s->v_edge_pos , EDGE_WIDTH );
draw_edges(s->current_picture.data[1], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); draw_edges(s->current_picture.data[1], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2);
draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2);
......
...@@ -173,6 +173,8 @@ typedef struct Picture{ ...@@ -173,6 +173,8 @@ typedef struct Picture{
int frame_num; ///< h264 frame_num int frame_num; ///< h264 frame_num
int pic_id; ///< h264 pic_num or long_term_pic_idx int pic_id; ///< h264 pic_num or long_term_pic_idx
int long_ref; ///< 1->long term reference 0->short term reference int long_ref; ///< 1->long term reference 0->short term reference
int ref_poc[2][16]; ///< h264 POCs of the frames used as reference
int ref_count[2]; ///< number of entries in ref_poc
int mb_var_sum; ///< sum of MB variance for current frame int mb_var_sum; ///< sum of MB variance for current frame
int mc_mb_var_sum; ///< motion compensated MB variance for current frame int mc_mb_var_sum; ///< motion compensated MB variance for current frame
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment