History

h264: move decode_mb_skip() from h264.h to h.264_mvpred.h

This resolves a circular dependency between the headers.

Diego Biurrun committed 15 years ago

Commit 028216b1 parent 98704132 files · +39 −41Browse files

Unified · Split

2 files
  1. libavcodec/h264.h +0 −41
  2. libavcodec/h264_mvpred.h +39 −0
libavcodec/h264.h+0−41
@@ -770,8 +770,6 @@ static av_always_inline int get_chroma_qp(H264Context *h, int t, int qscale){ · 769 unmodified lines
770770 return h->pps.chroma_qp_table[t][qscale];
771771 }
772772
773−#include "h264_mvpred.h" //For pred_pskip_motion()
774−
775773 static void fill_decode_neighbors(H264Context *h, int mb_type){
776774 MpegEncContext * const s = &h->s;
777775 const int mb_xy= h->mb_xy;
@@ -1302,43 +1300,4 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h){ · 524 unmodified lines
13021300 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8|MB_TYPE_DIRECT2)*0x0001000100010001ULL));
13031301 }
13041302
1305−/**
1306− * decodes a P_SKIP or B_SKIP macroblock
1307− */
1308−static void av_unused decode_mb_skip(H264Context *h){
1309− MpegEncContext * const s = &h->s;
1310− const int mb_xy= h->mb_xy;
1311− int mb_type=0;
1312−
1313− memset(h->non_zero_count[mb_xy], 0, 48);
1314−
1315− if(MB_FIELD)
1316− mb_type|= MB_TYPE_INTERLACED;
1317−
1318− if( h->slice_type_nos == AV_PICTURE_TYPE_B )
1319− {
1320− // just for fill_caches. pred_direct_motion will set the real mb_type
1321− mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
1322− if(h->direct_spatial_mv_pred){
1323− fill_decode_neighbors(h, mb_type);
1324− fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
1325− }
1326− ff_h264_pred_direct_motion(h, &mb_type);
1327− mb_type|= MB_TYPE_SKIP;
1328− }
1329− else
1330− {
1331− mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
1332−
1333− fill_decode_neighbors(h, mb_type);
1334− pred_pskip_motion(h);
1335− }
1336−
1337− write_back_motion(h, mb_type);
1338− s->current_picture.f.mb_type[mb_xy] = mb_type;
1339− s->current_picture.f.qscale_table[mb_xy] = s->qscale;
1340− h->slice_table[ mb_xy ]= h->slice_num;
1341− h->prev_mb_skipped= 1;
1342−}
1343−
13441303 #endif /* AVCODEC_H264_H */
libavcodec/h264_mvpred.h+39−0
@@ -327,4 +327,43 @@ zeromv: · 326 unmodified lines
327327 return;
328328 }
329329
330+/**
331+ * decodes a P_SKIP or B_SKIP macroblock
332+ */
333+static void av_unused decode_mb_skip(H264Context *h){
334+ MpegEncContext * const s = &h->s;
335+ const int mb_xy= h->mb_xy;
336+ int mb_type=0;
337+
338+ memset(h->non_zero_count[mb_xy], 0, 48);
339+
340+ if(MB_FIELD)
341+ mb_type|= MB_TYPE_INTERLACED;
342+
343+ if( h->slice_type_nos == AV_PICTURE_TYPE_B )
344+ {
345+ // just for fill_caches. pred_direct_motion will set the real mb_type
346+ mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
347+ if(h->direct_spatial_mv_pred){
348+ fill_decode_neighbors(h, mb_type);
349+ fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
350+ }
351+ ff_h264_pred_direct_motion(h, &mb_type);
352+ mb_type|= MB_TYPE_SKIP;
353+ }
354+ else
355+ {
356+ mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
357+
358+ fill_decode_neighbors(h, mb_type);
359+ pred_pskip_motion(h);
360+ }
361+
362+ write_back_motion(h, mb_type);
363+ s->current_picture.f.mb_type[mb_xy] = mb_type;
364+ s->current_picture.f.qscale_table[mb_xy] = s->qscale;
365+ h->slice_table[ mb_xy ]= h->slice_num;
366+ h->prev_mb_skipped= 1;
367+}
368+
330369 #endif /* AVCODEC_H264_MVPRED_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t